Object orientied optimized variant of the semver package
Project description
csemver
csemver is the object orientied optimized Version of semver. It is much more consistent because you only need one object for all operations.
Features
Increase Versions
To increase the different versions csemver provides three methods
- incMajor
- incMinor
- incPatch
from csemver import csemver as Version
a = Version();
print(a)
a.incMajor();
print(a)
a.incMinor();
print(a)
a.incPatch();
print(a)
foo@bar:~$ python test.py
0.1.0
1.0.0
1.1.0
1.1.1
Overwrite Version
To overwrite the current Version just set a new Semver-String for csemver.number
from csemver import csemver as Version
a = Version();
print(a)
a.number ="1.0.0-pre+build.1";
print(a)
foo@bar:~$ python test.py
0.1.0
1.0.0-pre+build.1
Reset Version
Delete the number property to reset the Version to 0.1.0
from csemver import csemver as Version
a = Version("1.0.0");
print(a)
del a.number
print(a)
foo@bar:~$ python test.py
1.0.0
0.1.0
Compare different versions:
You can compare csemver instances with >, >=, ==, !=, <=, <
from csemver import csemver as Version
a = Version("1.1.1")
b = Version("1.1.1")
repr(a)
repr(b)
print(a<b)
b.incPatch()
print(b)
print(a<b)
foo@bar:~$ python test.py
Version<1.1.1> instance at 0x00000159D2061BA8
Version<1.1.1> instance at 0x00000159D2061DD8
False
1.1.2
True
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file csemver-0.1.0.tar.gz.
File metadata
- Download URL: csemver-0.1.0.tar.gz
- Upload date:
- Size: 15.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.18.4 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.31.0 CPython/3.6.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43ebd1b3dfda17f6eb43ea12e5542aa27871599c34421ae261c98b33faf520ff
|
|
| MD5 |
13cee4bee3a3812d9599c24c2fde815d
|
|
| BLAKE2b-256 |
030e8cf90b5702536fa1d421ce9168520ab9b4f3e149eabf65bbd4234759da37
|
File details
Details for the file csemver-0.1.0-py3-none-any.whl.
File metadata
- Download URL: csemver-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.18.4 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.31.0 CPython/3.6.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6df4c19a9d8ed9b968cd9132b0f93752c20f64d36ab0799459001148d8eed3ff
|
|
| MD5 |
565c8d6e042217526cabd5de611c00a6
|
|
| BLAKE2b-256 |
4ec739fa9289f5bcc4d3bc3fb772c8bb68a11b40a11b8be4ddd373ede931b62a
|