Skip to main content

A library for checking the latest revisions of standard methods published by standard bodies.

Project description

Stdchecker

PyPI

Stdchecker is a Python library for checking the latest revisions of standard methods published by standard bodies. Supported standard bodies are:

  • ASTM - American Society for Testing and Materials
  • IEC - The International Electrotechnical Commission
  • IEEE - The Institute of Electrical and Electronics Engineers
  • TSE - Turkish Standards Institution (Türk Standardları Enstitüsü)

Requirements

  • Python 3.8+

Installation

Use the package manager pip to install stdchecker:

pip install stdchecker

or directly from the source code:

git clone https://github.com/emreture/stdchecker.git
cd stdchecker
python setup.py install

Usage

Fetching standard methods data:

import stdchecker

std_list = ['D92', 'D93']

for i in stdchecker.fetch_astm(std_list):
    print(i)

Output:

{'query': 'D92',
 'error': None,
 'no': 'ASTM D92',
 'rev': '18',
 'desc': 'Standard Test Method for Flash and Fire Points by Cleveland Open Cup Tester',
 'body': 'astm',
 'url': 'https://www.astm.org/Standards/D92.htm'}

{'query': 'D93',
 'error': None,
 'no': 'ASTM D93',
 'rev': '20',
 'desc': 'Standard Test Methods for Flash Point by Pensky-Martens Closed Cup Tester',
 'body': 'astm',
 'url': 'https://www.astm.org/Standards/D93.htm'}

Checking if existing standard methods are up-to-date:

import stdchecker

std_list = ['D92', 'D93']
actual_std_list = [
    {'no': 'ASTM D92', 'rev': '18'},
    {'no': 'ASTM D93', 'rev': '18'}
]

fetch_generator = stdchecker.fetch_astm(std_list)
for i in stdchecker.check_astm(fetch_generator, actual_std_list):
    print(i)

Output:

{'query': 'D92',
 'error': None,
 'no': 'ASTM D92',
 'rev': '18',
 'desc': 'Standard Test Method for Flash and Fire Points by Cleveland Open Cup Tester',
 'body': 'astm',
 'url': 'https://www.astm.org/Standards/D92.htm',
 'check': True,
 'actual': '18'}

{'query': 'D93',
 'error': None,
 'no': 'ASTM D93',
 'rev': '20',
 'desc': 'Standard Test Methods for Flash Point by Pensky-Martens Closed Cup Tester',
 'body': 'astm',
 'url': 'https://www.astm.org/Standards/D93.htm',
 'check': False,
 'actual': '18'}

If an id is provided (for example existing standard methods are stored in a database), the output will also include the id key and its value:

import stdchecker

std_list = ['D92', 'D93']
actual_std_list = [
    {'id': 1, 'no': 'ASTM D92', 'rev': '18'},
    {'id': 2, 'no': 'ASTM D93', 'rev': '18'}
]

fetch_generator = stdchecker.fetch_astm(std_list)
for i in stdchecker.check_astm(fetch_generator, actual_std_list, id_from_actual=True):
    print(i)

Output:

{'query': 'D92',
 'error': None,
 'no': 'ASTM D92',
 'rev': '18',
 'desc': 'Standard Test Method for Flash and Fire Points by Cleveland Open Cup Tester',
 'body': 'astm',
 'url': 'https://www.astm.org/Standards/D92.htm',
 'check': True,
 'actual': '18',
 'id': 1}

{'query': 'D93',
 'error': None,
 'no': 'ASTM D93',
 'rev': '20',
 'desc': 'Standard Test Methods for Flash Point by Pensky-Martens Closed Cup Tester',
 'body': 'astm',
 'url': 'https://www.astm.org/Standards/D93.htm',
 'check': False,
 'actual': '18',
 'id': 2}

For more documentation, refer to the docstrings in the source files.

License

See the LICENSE file for license rights and limitations (MIT).

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

stdchecker-0.1.6.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stdchecker-0.1.6-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file stdchecker-0.1.6.tar.gz.

File metadata

  • Download URL: stdchecker-0.1.6.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.13

File hashes

Hashes for stdchecker-0.1.6.tar.gz
Algorithm Hash digest
SHA256 513d4c1da9b8413d9a505a2da1a198f1bd54f17468fbc0df5c084ce9b45044b4
MD5 9ef4b8a0e1a15ec31ed629c09cacff90
BLAKE2b-256 409bc1d5ecd31f23e7d4dfa77bccc9255eedbbec5587f795df61d77283bc241f

See more details on using hashes here.

File details

Details for the file stdchecker-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: stdchecker-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.13

File hashes

Hashes for stdchecker-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 011294a44ed649bc68cc011e0f9e8cd4c3e924adce48037b98275284efa68495
MD5 64ce6157c5ffbd7187c938f81fc1b883
BLAKE2b-256 4959e808a0e267ff7a756824a2070dcd254899aacf926e1227c5c0479544e9f7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page