-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 3e59063
Showing
28 changed files
with
1,293 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[run] | ||
source = vininfo/ | ||
omit = vininfo/cli.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.project | ||
.pydevproject | ||
.idea | ||
.tox | ||
__pycache__ | ||
*.pyc | ||
*.pyo | ||
*.egg-info | ||
docs/_build/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
syntax:glob | ||
|
||
.project | ||
.pydevproject | ||
.idea | ||
.tox | ||
__pycache__ | ||
*.pyc | ||
*.pyo | ||
*.egg-info | ||
docs/_build/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
strictness: medium | ||
|
||
autodetect: yes | ||
|
||
ignore-paths: | ||
- docs | ||
- tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
language: python | ||
|
||
python: | ||
- 3.6 | ||
- 3.5 | ||
- 3.4 | ||
- 2.7 | ||
|
||
install: | ||
- pip install pytest coveralls | ||
|
||
script: | ||
- coverage run --source=vininfo setup.py test | ||
|
||
after_success: | ||
- coveralls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
vininfo authors | ||
=============== | ||
|
||
Created by Igor `idle sign` Starikov. | ||
|
||
|
||
Contributors | ||
------------ | ||
|
||
Here could be your name. | ||
|
||
|
||
|
||
Translators | ||
----------- | ||
|
||
Here could be your name. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
vininfo changelog | ||
================= | ||
|
||
|
||
Unreleased | ||
---------- | ||
+ Basic functionality. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
vininfo contributing | ||
==================== | ||
|
||
|
||
Submit issues | ||
------------- | ||
|
||
If you spotted something weird in application behavior or want to propose a feature you are welcome. | ||
|
||
|
||
Write code | ||
---------- | ||
If you are eager to participate in application development and to work on an existing issue (whether it should | ||
be a bugfix or a feature implementation), fork, write code, and make a pull request right from the forked project page. | ||
|
||
|
||
Spread the word | ||
--------------- | ||
|
||
If you have some tips and tricks or any other words that you think might be of interest for the others — publish it | ||
wherever you find convenient. | ||
|
||
|
||
See also: https://github.com/idlesign/vininfo | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
vininfo installation | ||
==================== | ||
|
||
|
||
Python ``pip`` package is required to install ``vininfo``. | ||
|
||
|
||
From sources | ||
------------ | ||
|
||
Use the following command line to install ``vininfo`` from sources directory (containing setup.py): | ||
|
||
pip install . | ||
|
||
or | ||
|
||
python setup.py install | ||
|
||
|
||
From PyPI | ||
--------- | ||
|
||
Alternatively you can install ``vininfo`` from PyPI: | ||
|
||
pip install vininfo | ||
|
||
|
||
Use `-U` flag for upgrade: | ||
|
||
pip install -U vininfo | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
Copyright (c) 2018, Igor `idle sign` Starikov | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
* Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
|
||
* Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
* Neither the name of the vininfo nor the names of its | ||
contributors may be used to endorse or promote products derived from | ||
this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
include AUTHORS | ||
include CHANGELOG | ||
include INSTALL | ||
include LICENSE | ||
include README.rst | ||
|
||
include docs/Makefile | ||
recursive-include docs *.rst | ||
recursive-include docs *.py | ||
recursive-include tests * | ||
|
||
recursive-exclude * __pycache__ | ||
recursive-exclude * *.py[co] | ||
recursive-exclude * empty | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
vininfo | ||
======= | ||
https://github.com/idlesign/vininfo | ||
|
||
|release| |lic| |ci| |coverage| |health| | ||
|
||
.. |release| image:: https://img.shields.io/pypi/v/vininfo.svg | ||
:target: https://pypi.python.org/pypi/vininfo | ||
|
||
.. |lic| image:: https://img.shields.io/pypi/l/vininfo.svg | ||
:target: https://pypi.python.org/pypi/vininfo | ||
|
||
.. |ci| image:: https://img.shields.io/travis/idlesign/vininfo/master.svg | ||
:target: https://travis-ci.org/idlesign/vininfo | ||
|
||
.. |coverage| image:: https://img.shields.io/coveralls/idlesign/vininfo/master.svg | ||
:target: https://coveralls.io/r/idlesign/vininfo | ||
|
||
.. |health| image:: https://landscape.io/github/idlesign/vininfo/master/landscape.svg?style=flat | ||
:target: https://landscape.io/github/idlesign/vininfo/master | ||
|
||
|
||
Description | ||
----------- | ||
|
||
*Extracts useful information from Vehicle Identification Number (VIN)* | ||
|
||
* Can be used as a standalone console application (CLI). | ||
* One can also use import it as any other package in your Python code. | ||
* Gives basic and detailed info (is available) about VIN. | ||
* Allows VIN checksum verification. | ||
|
||
|
||
Requirements | ||
------------ | ||
|
||
* Python 2.7, 3.4+ | ||
* `click` package for CLI | ||
|
||
|
||
Usage | ||
----- | ||
|
||
CLI | ||
~~~ | ||
|
||
`click` package is required for CLI. You can install `vininfo` with `click` using:: | ||
|
||
$ pip install vininfo[cli] | ||
|
||
|
||
.. code-block:: bash | ||
$ vininfo --help | ||
; Print out VIN info: | ||
$ vininfo show XTAGFK330JY144213 | ||
; Basic: | ||
; Country: USSR/CIS | ||
; Manufacturer: AvtoVAZ | ||
; Region: Europe | ||
; Years: 2018, 1988 | ||
; | ||
; Details: | ||
; Coachwork: Station Wagon | ||
; Engine: 21179 | ||
; Model: Vesta | ||
; Plant: Izhevsk | ||
; Serial: 144213 | ||
; Transmission: Manual Renault | ||
; Verify checksum | ||
$ vininfo check 1M8GDM9AXKP042788 | ||
; Checksum is valid | ||
Python | ||
~~~~~~ | ||
|
||
.. code-block:: python | ||
from vininfo import Vin | ||
vin = Vin('VF1LM1B0H36666155') | ||
vin.country # France | ||
vin.manufacturer # Renault | ||
vin.region # Europe | ||
vin.vis # 36666155 | ||
vin.vis # 36666155 | ||
annotated = vin.annotate() | ||
details = vin.details | ||
vin.verify_checksum() # False | ||
Vin('1M8GDM9AXKP042788').verify_checksum() # True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[aliases] | ||
release = clean --all sdist bdist_wheel upload | ||
test = pytest | ||
|
||
[wheel] | ||
universal = 1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import io | ||
import os | ||
import re | ||
|
||
from setuptools import setup, find_packages | ||
|
||
import sys | ||
|
||
PATH_BASE = os.path.dirname(__file__) | ||
|
||
|
||
def read_file(fpath): | ||
"""Reads a file within package directories.""" | ||
with io.open(os.path.join(PATH_BASE, fpath)) as f: | ||
return f.read() | ||
|
||
|
||
def get_version(): | ||
"""Returns version number, without module import (which can lead to ImportError | ||
if some dependencies are unavailable before install.""" | ||
contents = read_file(os.path.join('vininfo', '__init__.py')) | ||
version = re.search('VERSION = \(([^)]+)\)', contents) | ||
version = version.group(1).replace(', ', '.').strip() | ||
return version | ||
|
||
|
||
setup( | ||
name='vininfo', | ||
version=get_version(), | ||
url='https://github.com/idlesign/vininfo', | ||
|
||
description='Extracts useful information from Vehicle Identification Number (VIN)', | ||
long_description=read_file('README.rst'), | ||
license='BSD 3-Clause License', | ||
|
||
author='Igor `idle sign` Starikov', | ||
author_email='[email protected]', | ||
|
||
packages=find_packages(), | ||
include_package_data=True, | ||
zip_safe=False, | ||
|
||
install_requires=[], | ||
setup_requires=[] + (['pytest-runner'] if 'test' in sys.argv else []) + [], | ||
|
||
extras_require={ | ||
'cli': ['click'], | ||
}, | ||
|
||
entry_points={ | ||
'console_scripts': ['vininfo = vininfo.cli:main'], | ||
}, | ||
|
||
test_suite='tests', | ||
|
||
tests_require = ['pytest'], | ||
|
||
classifiers=[ | ||
# As in https://pypi.python.org/pypi?:action=list_classifiers | ||
'Development Status :: 4 - Beta', | ||
'Operating System :: OS Independent', | ||
'Programming Language :: Python', | ||
'Programming Language :: Python :: 2', | ||
'Programming Language :: Python :: 2.7', | ||
'Programming Language :: Python :: 3.4', | ||
'Programming Language :: Python :: 3.5', | ||
'Programming Language :: Python :: 3.6', | ||
'Programming Language :: Python :: 3.7', | ||
'License :: OSI Approved :: BSD License' | ||
], | ||
) |
Oops, something went wrong.