Skip to main content

Version extractor

A tool for extracting the version of a Python file.

Version extractor Pypi package page Version extractor latest documentation Status Version extractor development documentation Status

Features

  • Extract the value from a version field inside any Python file

Documentation

Documentation sources are included with the project, and used to generate the documentation sites:

  • The latest docs are always generated for the latest release, kept in the ‘master’ branch

  • The development docs are generated from the latest code in the ‘develop’ branch

You can also create the documentation from the source files, kept in the ‘docs’ folder, with the help of Sphinx. For this use the makefile, or the make.bat file, contained on that folder.

Prerequisites

The project has been tested in the following versions of the interpreter:

  • Python 3.4

  • Python 3.5

  • Python 3.6

  • Pypy 3

All other dependencies are indicated on the requirements.txt file.

These can be installed with:

$ pip install --upgrade -r requirements.txt

Installing

The project is offered as a Pypi package, and using pip is the preferred way to install it. For this use the following command;

$ pip install bernardomg.version-extractor

If needed, manual installation is possible:

$ python setup.py install

Usage

Just import and use the function:

from version_extractor import extract_version

version = extract_version('tests/resources/__init__.py')

Or use a preconfigured function:

from version_extractor import extract_version_init

version = extract_version_init('tests/resources')

This is useful when setting up a setup.py file:

setup(
    ...
    version=extract_version_init(_source_package),
    ...
)

Testing

The tests included with the project can be run with:

$ python setup.py test

This will delegate the execution to tox.

It is possible to run just one of the test profiles, in this case the py36 profile:

$ python setup.py test -p "py36"

Collaborate

Any kind of help with the project will be well received, and there are two main ways to give such help:

  • Reporting errors and asking for extensions through the issues management

  • or forking the repository and extending the project

Issues management

Issues are managed at the GitHub project issues tracker, where any Github user may report bugs or ask for new features.

Getting the code

If you wish to fork or modify the code, visit the GitHub project page, where the latest versions are always kept. Check the ‘master’ branch for the latest release, and the ‘develop’ for the current, and stable, development version.

License

The project has been released under the MIT License.

Metadata

Release files for bernardomg.version-extractor 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bernardomg.version-extractor 1.1.0
File Size Uploaded
bernardomg.version_extractor-1.1.0.tar.gz 11.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bernardomg.version-extractor 1.1.0
File Interpreter ABI Platform
bernardomg.version_extractor-1.1.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 18.2 kB

Release files / bernardomg.version_extractor-1.1.0.tar.gz

Download URL bernardomg.version_extractor-1.1.0.tar.gz
Size 11.7 kB
Tags Source
SHA-256 checksum
How to use checksums
799897db01bf7421c87214f2a9b167499e7c54f2df5f64b377ebc987a63530ec
BLAKE2b-256 checksum
How to use checksums
a28af35d2adcef34bb19278e6f718799d3263f2097d80c3a13bc50583f64b8be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.9.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

Release files / bernardomg.version_extractor-1.1.0-py2.py3-none-any.whl

Download URL bernardomg.version_extractor-1.1.0-py2.py3-none-any.whl
Size 6.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
9377d5ecced43ccdb6b02f5c030da605ad62f742f592133e5a040b9a741df48e
BLAKE2b-256 checksum
How to use checksums
0be012695df9a5c13b578a361b2af80034a3688be8023d4e7ad3fc02f7814242
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.9.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page