
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Key Features • How To Use • How it works • Common use cases • Operations • Roadmap
Have you ever tried to understand a date like 11-09, št? Is the št an abbreviation of a month or a weekday? Which of those numbers represent the month or the day? This library leverages on Good Ol' Fashioned AI to parse abbreviated, ambiguous, and incomplete dates in multiple languages.
The most straightforward way to parse dates is to use the datetime.date() function, that wraps around most of the functionality of the module. This example shows a basic usage of the library to parse the date: "11-09, št":
from datetime import datetime
from fuzzy_parser.engine import Engine
start = datetime(2021, 4, 27).date()
(semantic, _) = Engine(start).when('11-09, št')
for single_date in semantic:
print(single_date.strftime("%Y-%m-%d"))
The output will show the expected
2021-09-11
The abbreviation "št" could stand for:
Lithuanian is spoken in Lithuania and in Latvia. Slovak is spoken in Slovakia but also by a minority in the Czech Republic. These countries use different date representations: Czech Republic, Latvia and Slovakia have the day written first because of the "little" date endianness format used as the standard in the country. Lithuania, on the other hand, uses the "big" date endianness format which means that the month is written first. The system factor in all these facts and is able to come with the right answers:
In the case of interpreting the abbreviation as a Saturday:
In the case of interpreting the abbreviation as a Thursday:
For further details have a look at the underlying implementation. In addition, the unit tests might give an impression on how to use this library.
Consuming data from different sources:
We are leveraging GNU Make to automate frequent actions. Please use the following command will show the available recipes to use for operating the local development environment:
make help
Command | Description |
---|---|
help | Print this help |
synchronize | Switch to the main branch, fetch changes & delete merged branches |
test | Run the test suite |
run-time | Install the packages packs required for the development environment |
install | Install the latest library release |
uninstall | Uninstall the latest library release |
release | Release recipe to be use from Github Actions |
bump | Increase the version number |
build | Build and check distribution packages |
publish | Publish the diagrams |
workflow | Creates the Diagrams |
remove-all | Remove packages and packs |
clean | Remove debris |
The following command stores pypi.org token to "Upload packages" in the local key store to be used by the publish option:
secret-tool store --label='https://pypi.org/manage/account/token/' user ${USER} domain pypi.org
Tested with SWI-Prolog version 8.2.4 on Ubuntu 20.04
Distributed under the MIT License. See LICENSE
file for more information.
FAQs
A parser for fuzzy dates
We found that fuzzy-parser 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
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.