Dunder Mac OS
PEP: | 396 |
---|---|
Title: | Module Version Numbers |
Version: | 65628 |
Last-Modified: | 2008-08-10 09:59:20 -0400 (Sun, 10 Aug 2008) |
Author: | Barry Warsaw <barry at python.org> |
Status: | Rejected |
Type: | Informational |
Created: | 16-Mar-2011 |
Post-History: | 2011-04-05 |
Contents
Shop the latest Alfred Dunner's collections at Macy's. From stylish pants to trendy tops, we carry a variety of Alfred Dunner's clothes. FREE SHIPPING available! Apr 25, 2020 - SearchZone Search is a browser hijacker that hijacks the new tab, search engine, and homepage in Google Chrome, Firefox, Internet Explorer, Chromium Edge,. Dunder definition is - a noise like thunder: a noisy blow.
- Deriving
Given that it is useful and common to specify version numbers forPython modules, and given that different ways of doing this have grownorganically within the Python community, it is useful to establishstandard conventions for module authors to adhere to and reference.This informational PEP describes best practices for Python moduleauthors who want to define the version number of their Python module.
Conformance with this PEP is optional, however other Python tools(such as distutils2[1]) may be adapted to use the conventionsdefined here.
- Used to be a great app, a social media site that didn’t feel like social media. Now, there’s an ad on every other screen you see, some comment sections even include ads, there are constantly pop ups asking you to visit the AppStore to rate the app, constantly pop ups trying to ‘engage the user’ more (we get it, you’re making money off of us, no need to shove it down our.
- Poker Superstars For Mac Os X, casino de granville telephone, catalogue casino evasion hiver 2020, casino tokyo Free Spins Bgo Entertainment Limited (company registration number 1839) is a company registered in Alderney.
This PEP was formally rejected on 2021-04-14. The packaging ecosystemhas changed significantly in the intervening years since this PEP wasfirst written, and APIs such as importlib.metadata.versions()[11]provide for a much better experience.
Alice is writing a new module, called alice, which she wants toshare with other Python developers. alice is a simple module andlives in one file, alice.py. Alice wants to specify a versionnumber so that her users can tell which version they are using.Because her module lives entirely in one file, she wants to add theversion number to that file.
Bob has written a module called bob which he has shared with manyusers. bob.py contains a version number for the convenience ofhis users. Bob learns about the Cheeseshop [2], and adds some simplepackaging using classic distutils so that he can upload The BobBundle to the Cheeseshop. Because bob.py already specifies aversion number which his users can access programmatically, he wantsthe same API to continue to work even though his users now get it fromthe Cheeseshop.
Carol maintains several namespace packages, each of which areindependently developed and distributed. In order for her users toproperly specify dependencies on the right versions of her packages,she specifies the version numbers in the namespace package'ssetup.py file. Because Carol wants to have to update one versionnumber per package, she specifies the version number in her module andhas the setup.py extract the module version number when she buildsthe sdist archive.
David maintains a package in the standard library, and also producesstandalone versions for other versions of Python. The standardlibrary copy defines the version number in the module, and this sameversion number is used for the standalone distributions as well.
Python modules, both in the standard library and available from thirdparties, have long included version numbers. There are establishedde facto standards for describing version numbers, and many ad-hocways have grown organically over the years. Often, version numberscan be retrieved from a module programmatically, by importing themodule and inspecting an attribute. Classic Python distutilssetup() functions [3] describe a version argument where therelease's version number can be specified. PEP 8[4] describes theuse of a module attribute called __version__ for recording'Subversion, CVS, or RCS' version strings using keyword expansion. Inthe PEP author's own email archives, the earliest example of the useof an __version__ module attribute by independent moduledevelopers dates back to 1995.
Another example of version information is the sqlite3 [5] modulewith its sqlite_version_info, version, and version_infoattributes. It may not be immediately obvious which attributecontains a version number for the module, and which contains a versionnumber for the underlying SQLite3 library.
This informational PEP codifies established practice, and recommendsstandard ways of describing module version numbers, along with someuse cases for when -- and when not -- to include them. Its adoptionby module authors is purely voluntary; packaging tools in the standardlibrary will provide optional support for the standards definedherein, and other tools in the Python universe may comply as well.
- In general, modules in the standard library SHOULD NOT have versionnumbers. They implicitly carry the version number of the Pythonrelease they are included in.
- On a case-by-case basis, standard library modules which are alsoreleased in standalone form for other Python versions MAY include amodule version number when included in the standard library, andSHOULD include a version number when packaged separately.
- When a module (or package) includes a version number, the versionSHOULD be available in the __version__ attribute.
- For modules which live inside a namespace package, the moduleSHOULD include the __version__ attribute. The namespacepackage itself SHOULD NOT include its own __version__attribute.
- The __version__ attribute's value SHOULD be a string.
- Module version numbers SHOULD conform to the normalized versionformat specified in PEP 386[6].
- Module version numbers SHOULD NOT contain version control systemsupplied revision numbers, or any other semantically differentversion numbers (e.g. underlying library version number).
- The version attribute in a classic distutils setup.pyfile, or the PEP 345[7]Version metadata field SHOULD bederived from the __version__ field, or vice versa.
Retrieving the version number from a third party package:
Retrieving the version number from a standard library package that isalso distributed as a standalone module:
Version numbers for namespace packages:
Module version numbers can appear in at least two places, andsometimes more. For example, in accordance with this PEP, they areavailable programmatically on the module's __version__ attribute.In a classic distutils setup.py file, the setup() functiontakes a version argument, while the distutils2 setup.cfg filehas a version key. The version number must also get into the PEP345 metadata, preferably when the sdist archive is built. It'sdesirable for module authors to only have to specify the versionnumber once, and have all the other uses derive from this singledefinition.
This could be done in any number of ways, a few of which are outlinedbelow. These are included for illustrative purposes only and are notintended to be definitive, complete, or all-encompassing. Otherapproaches are possible, and some included below may have limitationsthat prevent their use in some situations.
Let's say Elle adds this attribute to her module file elle.py:
Classic distutils
In classic distutils, the simplest way to add the version string tothe setup() function in setup.py is to do something likethis:
In the PEP author's experience however, this can fail in some cases,such as when the module uses automatic Python 3 conversion via the2to3 program (because setup.py is executed by Python 3 beforethe elle module has been converted).
In that case, it's not much more difficult to write a little code toparse the __version__ from the file rather than importing it.Without providing too much detail, it's likely that modules such asdistutils2 will provide a way to parse version strings from files.E.g.:
Distutils2
Because the distutils2 style setup.cfg is declarative, we can'trun any code to extract the __version__ attribute, either viaimport or via parsing.
In consultation with the distutils-sig [9], two options areproposed. Both entail containing the version number in a file, anddeclaring that file in the setup.cfg. When the entire contents ofthe file contains the version number, the version-file key will beused:
When the version number is contained within a larger file, e.g. ofPython code, such that the file must be parsed to extract the version,the key version-from-file will be used:
A parsing method similar to that described above will be performed onthe file named after the colon. The exact recipe for doing this willbe discussed in the appropriate distutils2 development forum.
An alternative is to only define the version number in setup.cfgand use the pkgutil module [8] to make it availableprogrammatically. E.g. in elle.py:
PEP 376[10] defines a standard for static metadata, but doesn'tdescribe the process by which this metadata gets created. It ishighly desirable for the derived version information to be placed intothe PEP 376.dist-info metadata at build-time rather thaninstall-time. This way, the metadata will be available forintrospection even when the code is not installed.
[1] | Distutils2 documentation(http://distutils2.notmyidea.org/) |
[2] | The Cheeseshop (Python Package Index)(http://pypi.python.org) |
[3] | http://docs.python.org/distutils/setupscript.html |
[4] | PEP 8, Style Guide for Python Code(http://www.python.org/dev/peps/pep-0008) |
[5] | sqlite3 module documentation(http://docs.python.org/library/sqlite3.html) |
[6] | PEP 386, Changing the version comparison module in Distutils(http://www.python.org/dev/peps/pep-0386/) |
[7] | PEP 345, Metadata for Python Software Packages 1.2(http://www.python.org/dev/peps/pep-0345/#version) |
[8] | pkgutil - Package utilities(http://distutils2.notmyidea.org/library/pkgutil.html) |
[9] | https://mail.python.org/pipermail/distutils-sig/2011-June/017862.html |
[10] | PEP 376, Database of Installed Python Distributions(http://www.python.org/dev/peps/pep-0376/) |
[11] | importlib.metadata(https://docs.python.org/3/library/importlib.metadata.html#distribution-versions) |
This document has been placed in the public domain.
Source: https://github.com/python/peps/blob/master/pep-0396.txtA dashboard can help you better understand your business, application, process, or any other entity that creates data for analysis. Simply visualizing data is a powerful method to uncover insights, see progress, and motivate yourself–or others–to act. Creating your dashboard does not need to be complicated.
This guide will walk you through a sample project and cover:
Already sending events to Keen and ready to build a dashboard? Or new to Keen and want to build a dashboard with sample data? Click here!
Choose Your Metrics
You might be tempted to jump into making a dashboard before you think about what data to measure. If you skip this step now, you’ll definitely need to come back. Knowing what you want to track really is the first step because it informs what data you need to collect. Also, since you’ll be communicating these metrics to others with the dashboard, you’re placing significance on them. So, you better make sure they matter.
There is no magic number of metrics to choose and it depends a lot on how you’ll use your dashboard. As a best practice, one is probably too few, and ten is bound to be too many. Your dashboard should give enough information to be valuable without giving too much to be actionable.
By narrowing your focus, you have the flexibility to show each metric in multiple ways. You can view the total for the most recent period, as well as showing the trend, and maybe comparing the metric to another value.
Collect Your Data
Armed with your most important metrics, you’re ready to dive into data collection. In this section, you’ll learn a couple different methods for getting data into Keen, and how we structure the events you capture. You’ll also be introduced to the example dataset we’ll use to create a beautiful, actionable dashboard.
The most basic way to load data into Keen is to send events as they happen, along with their associated data. An event can be any action such as a click, pageview, signup, or conversion, to name just a few. As a test, you can use cURL, a simple data transfer program built into most operating systems, to post your first event to Keen. Run this from a command line (you can access this in the Terminal application on a Mac, for instance):
There are two fields you need to fill in from your project page: PROJECT_ID
and WRITE_KEY
. You can access these keys in the Access tab within your project page.
Once you’ve successfully added the event via the API, the Streams tab in your project can show your latest events. Select the testing
collection from the Event Streams list. We named the collection testing
in our cURL command:
You can use any collection name you want and it will be created upon receiving its first event. Here’s how our example event above might look:
As expected, the event contains our two fields that we sent as JSON data. Further, there’s a “keen” object with three values. The id
is a unique identifier for each event sent to Keen, the timestamp
is a field that a user can overwrite, and created_at
is the time that the event was created.
Most Keen customers use one of our SDK libraries to write events at scale, such as from active web or mobile applications. The data you send can describe device state, visitor data, user actions, or anything you want to visualize later.
In fact, you could send all of those different types of data in a single call, if you wanted. The JSON can be nested, for easy separation. The advertiser data you sent in the cURL call is actually within an “ad” object in the full browser data we’ll be using to create your first dashboard. Here’s a complete event from that sample data:
If you have a lot of data you want to load, you can use bulk load data in JSON or CSV format using our command line interface. To overwrite the timestamp, create a keen.timestamp
header for your CSV or nest within a “keen” object in your JSON data.
To save time, we’ll use a public version of the browser sample data to create your first dashboard. This sample dataset is based on more than 10,000 “pageview” events, each containing some version of the sample user, ad, and page data.
Visualize with Charts on a Dashboard
Once you’ve started collecting data, you’ll be eager to visualize it in a dashboard. When you choose your metrics, you’ll likely want to think about all the different ways you would want to show them. Your dashboard is where you can make this happen.
The focus of a dashboard should be the data, so there’s no reason to start anew when there are great examples already in the public domain. For this project, we’ll pick up a responsive dashboard template, another Keen project. There are a bunch of layouts to choose from and examples to inspire you. To get started, download the zip file from the GitHub repository.
Once you decompress the zip file, navigate to the layouts folder. You’ll see eight folders corresponding to the options listed on GitHub. For this project we’ll use the two-and-one layout, with two side by side square charts that sit atop a wide chart.
It doesn’t really matter which you choose right now–it’s really easy to switch later because the majority of the visualization will come from the charting library. A chart can easily be placed into any layout slot, though some orientations may be better than others to show certain types of data. A long or detailed time series, for example, can benefit from a wider layout slot. On the other hand, a pie chart would be fine for a square slot.
To add your first chart, open up two-and-one/index.html
in your favorite text or code editor. Open up the same file in your web browser, so you can get a feel for the layout without any charts. You don’t need to create any server-side component to display a dashboard, so everything we do in this guide will be visible on your local machine.
In this example we are using the keen-analysis.js and keen-dataviz.js library, but don’t worry - we already have included it for you in the file.
Dunder Mac Os X
The dimensions on your chart slots will be a little different. Resize your browser and the dimensions will change. These layouts are responsive to different sized windows, even on phones and tablets.
Step 1: Return to your text editor and find the first of these HTML blocks, about halfway down the file:
Remove the <img>
tag and leave that <div>
empty.
Step 2: Then add an <div>
id
attribute. In this example, we will set it to chart-01
. The result should look something like this:
The chart ID will be the “hook” we use to tell our JavaScript code where to put the chart. In your CSS file set height for this element, depending on the viewport for example:
Step 3: For this first chart, add the following script to your HTML page, just above the </body>
tag:
In this first example, we are showing an area chart of pageviews per browser over each hour of a 24 hour period. There are a number of other options described in the Visualize section, but we’ll use two more for the subsequent charts.
The projectId
and readKey
values are based on the sample data discussed previously. When you incorporate your own data, you’ll want to replace these with your own projectId
and readKey
from your Keen project page. If you have a common set of queries that you run, you can use the Explorer to copy and paste the JavaScript code for these queries and plug them right into your dashboard!
Run a query on your data in the explorer, click the “</> Embed” button to see the Javascript for it!
Note: You would use what is inside of the <script type='text/javascript'>
tags inside of a dashboard layout like in this example.
Step 4: For the next example, you can remove the <img>
tag again and leave the <div>
empty. Then add an id attribute to the <div>
Remember about setting its height in CSS. The result should look something like this:
Back to the JavaScript portion of your HTML file, add the following in the section prepared for sample two and add:
Like sample one, this is showing browser pageviews. However, this extends to five days worth of data, but uses a per-browser total, rather than slicing by the hour. And instead of an area chart, this is displayed as a pie chart.
Step 5: For the last example, you will need to add a <div>
id attribute set to “chart-03” and remove the <img>
tag again.
To close out the sample charts, paste the following in the section prepared for sample three:
Here we are querying hypothetical advertisement impressions over a one day period, with hourly slices all grouped by advertiser. This is very similar to the query in sample one, but here the data is visualized as a column chart instead.
Dunder Mac Os Update
Step 6: Load up your HTML file with these three samples and you have your first complete dashboard.
Now might be the time to get back to the collect your data section and replace this data with your own. Then it’s time to get this dashboard in front of the people who need to see it.
Share with Your Team
Once you have metrics that are the drivers of your business or otherwise help you better understand your customers, you want to make sure everyone in the company has access to the insights displayed in your dashboard. There are endless ways you can share your dashboard, but here are a few with varying levels of publicity and shareability.
Since the dashboard is a simple HTML page that does not need a server, it can be stored anywhere. In this guide, we simply used the page on your local computer. If you expect the dashboard will not change much and won’t need a wide audience, you could simply keep it on your desktop and email it as an attachment. While that is the simplest method and will always have the latest data, you won’t be able to change the metrics in the dashboard without redistributing the file.
Another option is to use a file syncing service and share the file that way. Whenever you make a change to your version of the file, that change would be propagated to anyone with access.
A more advanced option would be to include the dashboard in an existing intranet, so anyone who logs in would be able to see the metrics that you’ve deemed most important. Other similar locations are an administrative panel of a website, or in a password-protected directory on a website.
Dunder Mac Os Download
Some dashboards, such as those for open source projects, can be public. In that case, GitHub Pages could be good location for simple hosting of your dashboard.
The important part here is to make this dashboard visible to those who need to see it and take actions based on what they see. If you’re able, make sure it’s somewhere that can be easily-updated, so that everyone always has access to your latest insights.
Example Dashboards
If you need some inspiration, consider these examples: