Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Convert numerical times to their human readable English language equivalent.
Examples:
15:00
becomes "Three o'clock"
15:15
becomes "Quarter past three"
15:27
becomes "Twenty seven minutes past three"
Distributed on PyPI - https://pypi.org/project/human-time/
Python >= 3.6 is required. The instructions below are focused on creating a Python 3 virtual environment in order to ringfence the dependencies.
The package can be installed from source:
cd human-time
python3 -m venv venv
source venv/bin/activate
python -m pip install -r requirements.txt
python -m pip install -e . --upgrade
Alternatively the package can be pulled from PyPi:
python3 -m pip install human-time
The installed application can then be invoked in two says, either as command line tool, which simply performs a single
time conversion, or as a server, which provides a REST API with single endpoint api/humantime
to convert the time.
humantime-server
starts by default on port 5000, this can be changed by setting the HUMANTIME_PORT
environment variable.
humantime -t 15:00
humantime-server
Both methods either return the human time corresponding to the current time, or if the numeric_time
parameter is
provided, the human time for the given numeric time.
If using humantime-server
, an OpenAPI user interface is available to test it's endpoint, which can be found at
Before testing ensure that the Python virtual environment is set up, and both unit test and application dependencies
are installed by running python3 -m pip install -r requirements.txt -r test/requirements.txt
To run the tests run python3 -m pytest --cov=src --pyargs test
The package is built, and deployed to PyPi via twine
, as shown below.
python3 -m pip install setuptools twine
python3 -m setup sdist
twine upload dist/*
FAQs
Converts digit based time formats to the english language equivalent
We found that human-time demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.