Name | jk-version JSON |
Version |
0.2023.9.11
JSON |
| download |
home_page | |
Summary | This python module provides a version class. Instances of this class may be used in representing and version numbers and compare them. |
upload_time | 2023-09-11 05:51:41 |
maintainer | |
docs_url | None |
author | Jürgen Knauth |
requires_python | |
license | Apache2 |
keywords |
version
versioning
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
jk_version
==========
Introduction
------------
This python module provides a version class. Instances of this class may be used in representing and version numbers and compare them.
Information about this module can be found here:
* [github.org](https://github.com/jkpubsrc/python-module-jk-version)
* [pypi.python.org](https://pypi.python.org/pypi/jk_version)
Why this module?
----------------
To manage data and software packages in a reasonable way versioning is important. For this you need to represent versions in computer memory.
This is what this module does: Provide version objects so that you can work with version information programmatically.
That's what this module has been written for.
Functionality
--------------------------
This module provides:
* `Version` - An object to represent version numbers in memory. (Parsing of version numbers is provided by this object as well.)
* Constraint classes that can be used to check versions:
* `BaseVersionConstraint` - the abstract base class for all constraints
* A set of concrete constraint classes: `VersionConstraint[GE|GT|LE|LT|NE|EQ|AND|OR]`
How to use this module
----------------------
### Import this module
Please include this module into your application using the following code:
```python
import jk_version
```
### Parse a version number
Version numbers can either be specified as lists of integers or as a string. Examples:
* `Version([ 1, 7, 51 ])`
* `Version(( 1, 7, 51 ))`
* `Version("1.7.51")`
Additionally you can use the following static method:
* `Version.parseFromStr("1.7.51")`
* `Version.parseFromStr("1.7.51", bStrict=True)`
### Version numbering schema
For compatibility reasons the version number parser is designed to accept the following schema:
*[ epoch ":" ] version_data [ "-" extra ]*
Where *epoch* is optional and - if present - must be an integer, and *version_data* is a regular version string consisting of decimal numbers separated by points.
Examples for valid version numbers:
* `0`
* `0.1`
* `0.1.2`
* `1`
* `1.7`
* `2020.12.24`
* `0.2022.8.6`
* `0.2022.8.6.1`
Parsing epoch information is supported:
* `2:0.1.2`
And an extra identifier is supported as well:
* `1.7-alpha`
* `0.1.2-dev`
* `1.2.3-stable`
* `2.3.4-SNAPSHOT`
* `3.4.5-beta2`
* `0.2022.8.6.2-rc1`
In non-strict mode (= default) parsing will handle strings such as this as well:
* `3.4.5.beta2`
### Generating version numbers
The `Version` class supports the generation of date based version numbers. Example:
```python
v = Version.now()
print(v)
```
This would build a version number such as this:
* `0.2022.8.6`
### Comparing version numbers
Version numbers can be compared. Example:
```python
v1 = Version("0.1.2")
v2 = Version("0.2.0")
print(v2 > v1)
```
This will result in: `True`
**NOTE:** Please note that extra identifiers are stored in version objects but are ignored otherwise. If you require to compare two versions and this comparison must take this extra identifier into account you need to implement your own comparison function for this purpose. This is because of the fact that there is no general convention how this extra information can be processed.
Compatible Modules
-------------------
Version number parsers:
* [PHP `composer` version parser](https://github.com/jkpubsrc/python-module-jk-php-version-parser)
Contact Information
-------------------
This work is Open Source. This enables you to use this work for free.
Please have in mind this also enables you to contribute. We, the subspecies of software developers, can create great things. But the more collaborate, the more fantastic these things can become. Therefore Feel free to contact the author(s) listed below, either for giving feedback, providing comments, hints, indicate possible collaborations, ideas, improvements. Or maybe for "only" reporting some bugs:
* Jürgen Knauth: pubsrc@binary-overflow.de
License
-------
This software is provided under the following license:
* Apache Software License 2.0
Raw data
{
"_id": null,
"home_page": "",
"name": "jk-version",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "version,versioning",
"author": "J\u00fcrgen Knauth",
"author_email": "pubsrc@binary-overflow.de",
"download_url": "https://files.pythonhosted.org/packages/76/05/5b573e4acf4220740993c976d074111bb454560a10bff7d6985d57a472e3/jk_version-0.2023.9.11.tar.gz",
"platform": null,
"description": "jk_version\n==========\n\nIntroduction\n------------\n\nThis python module provides a version class. Instances of this class may be used in representing and version numbers and compare them.\n\nInformation about this module can be found here:\n\n* [github.org](https://github.com/jkpubsrc/python-module-jk-version)\n* [pypi.python.org](https://pypi.python.org/pypi/jk_version)\n\nWhy this module?\n----------------\n\nTo manage data and software packages in a reasonable way versioning is important. For this you need to represent versions in computer memory.\nThis is what this module does: Provide version objects so that you can work with version information programmatically.\nThat's what this module has been written for.\n\nFunctionality\n--------------------------\n\nThis module provides:\n\n* `Version` - An object to represent version numbers in memory. (Parsing of version numbers is provided by this object as well.)\n* Constraint classes that can be used to check versions:\n\t* `BaseVersionConstraint` - the abstract base class for all constraints\n\t* A set of concrete constraint classes: `VersionConstraint[GE|GT|LE|LT|NE|EQ|AND|OR]`\n\nHow to use this module\n----------------------\n\n### Import this module\n\nPlease include this module into your application using the following code:\n\n```python\nimport jk_version\n```\n\n### Parse a version number\n\nVersion numbers can either be specified as lists of integers or as a string. Examples:\n\n* `Version([ 1, 7, 51 ])`\n* `Version(( 1, 7, 51 ))`\n* `Version(\"1.7.51\")`\n\nAdditionally you can use the following static method:\n\n* `Version.parseFromStr(\"1.7.51\")`\n* `Version.parseFromStr(\"1.7.51\", bStrict=True)`\n\n### Version numbering schema\n\nFor compatibility reasons the version number parser is designed to accept the following schema:\n\n*[ epoch \":\" ] version_data [ \"-\" extra ]*\n\nWhere *epoch* is optional and - if present - must be an integer, and *version_data* is a regular version string consisting of decimal numbers separated by points.\n\nExamples for valid version numbers:\n\n* `0`\n* `0.1`\n* `0.1.2`\n* `1`\n* `1.7`\n* `2020.12.24`\n* `0.2022.8.6`\n* `0.2022.8.6.1`\n\nParsing epoch information is supported:\n\n* `2:0.1.2`\n\nAnd an extra identifier is supported as well:\n\n* `1.7-alpha`\n* `0.1.2-dev`\n* `1.2.3-stable`\n* `2.3.4-SNAPSHOT`\n* `3.4.5-beta2`\n* `0.2022.8.6.2-rc1`\n\nIn non-strict mode (= default) parsing will handle strings such as this as well:\n\n* `3.4.5.beta2`\n\n### Generating version numbers\n\nThe `Version` class supports the generation of date based version numbers. Example:\n\n```python\nv = Version.now()\nprint(v)\n```\n\nThis would build a version number such as this:\n\n* `0.2022.8.6`\n\n### Comparing version numbers\n\nVersion numbers can be compared. Example:\n\n```python\nv1 = Version(\"0.1.2\")\nv2 = Version(\"0.2.0\")\nprint(v2 > v1)\n```\n\nThis will result in: `True`\n\n**NOTE:** Please note that extra identifiers are stored in version objects but are ignored otherwise. If you require to compare two versions and this comparison must take this extra identifier into account you need to implement your own comparison function for this purpose. This is because of the fact that there is no general convention how this extra information can be processed.\n\nCompatible Modules\n-------------------\n\nVersion number parsers:\n* [PHP `composer` version parser](https://github.com/jkpubsrc/python-module-jk-php-version-parser)\n\nContact Information\n-------------------\n\nThis work is Open Source. This enables you to use this work for free.\n\nPlease have in mind this also enables you to contribute. We, the subspecies of software developers, can create great things. But the more collaborate, the more fantastic these things can become. Therefore Feel free to contact the author(s) listed below, either for giving feedback, providing comments, hints, indicate possible collaborations, ideas, improvements. Or maybe for \"only\" reporting some bugs:\n\n* J\u00fcrgen Knauth: pubsrc@binary-overflow.de\n\nLicense\n-------\n\nThis software is provided under the following license:\n\n* Apache Software License 2.0",
"bugtrack_url": null,
"license": "Apache2",
"summary": "This python module provides a version class. Instances of this class may be used in representing and version numbers and compare them.",
"version": "0.2023.9.11",
"project_urls": null,
"split_keywords": [
"version",
"versioning"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "76055b573e4acf4220740993c976d074111bb454560a10bff7d6985d57a472e3",
"md5": "54ed79bfec21934d466d4cd7196784ad",
"sha256": "058b2d102c9159f42ea59a48055a45989d80ac6cf73c4940c669634af468155d"
},
"downloads": -1,
"filename": "jk_version-0.2023.9.11.tar.gz",
"has_sig": false,
"md5_digest": "54ed79bfec21934d466d4cd7196784ad",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 12849,
"upload_time": "2023-09-11T05:51:41",
"upload_time_iso_8601": "2023-09-11T05:51:41.646252Z",
"url": "https://files.pythonhosted.org/packages/76/05/5b573e4acf4220740993c976d074111bb454560a10bff7d6985d57a472e3/jk_version-0.2023.9.11.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-11 05:51:41",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "jk-version"
}