Add your description here
Project description
php-version-compare
A simple Python library for comparing version strings in a manner compatible with PHP's version_compare function. Although this implementation is not derived from PHP's code, it passes the same tests to ensure compatibility.
Installation
To install php-version-compare
, use pip:
pip install php-version-compare
Usage
from php_version_compare import version_compare
print(version_compare('1.0', '1.1')) # Output: -1
print(version_compare('1.1', '1.0')) # Output: 1
print(version_compare('1.0', '1.0')) # Output: 0
Contributing
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes.
- Commit your changes (
git commit -m 'Add new feature'
). - Push to the branch (
git push origin feature-branch
). - Open a pull request.
Running Tests
To run tests, make sure you have tox
installed and run:
tox
License
This project is licensed under either of the following, at your option:
- Apache License, Version 2.0 (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT License (LICENSE-MIT or https://opensource.org/licenses/MIT)
Which license to use is up to you. This project is dual-licensed for compatibility with both. When contributing, you agree to license your contributions under the same terms.
Versioning
This project uses Semantic Versioning. For the versions available, see the tags on this repository or the releases page.
Project details
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
Hashes for php_version_compare-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 809fdb3fbc97bd4459bcf2f56eb0d31ec13344d12b1df142e973a8fe7775bee6 |
|
MD5 | 54b08ac83b0ff54719e1ad9bd95acb1e |
|
BLAKE2b-256 | 87c68c34932cd7db77b0b61ed1cb1e8e846140378a5e64fc4572bfe18a01fa3a |
Hashes for php_version_compare-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8594fa93495c606afed2f97fb8e354e405b0bd841e68f9e9407590c38b3ff0f5 |
|
MD5 | 3e60be18295c2823409cb313452fa512 |
|
BLAKE2b-256 | a801336d95f4ed2f8abd7d8bdebff8841a1e789023989110e7ed1df9669f0b0d |