
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
A Singer tap for extracting data from the Holiday API.
Since package dependencies tend to conflict between various taps and targets, Singer recommends installing taps and targets into their own isolated virtual environments:
$ python3 -m venv ~/.venvs/tap-holidays
$ source ~/.venvs/tap-holidays/bin/activate
$ pip3 install tap-holidays
$ deactivate
$ python3 -m venv ~/.venvs/target-stitch
$ source ~/.venvs/target-stitch/bin/activate
$ pip3 install target-stitch
$ deactivate
The tap accepts a JSON-formatted configuration file as arguments. This configuration file has a single required field:
api_key
: A valid Holiday API key.An bare-bones Holiday API configuration may file may look like the following:
{
"api_key": "foo"
}
Additionally, you may specify more granular configurations for individual streams. Each key under a stream should represent a valid API request parameter for that endpoint. A more fleshed-out configuration file may look similar to the following:
{
"api_key": "foo",
"api_version": "v1",
"streams": {
"holidays": {
"country": "US",
"year": 2018,
"subdivisions": true
}
}
}
The current version of the tap syncs a single Stream:
Holidays
: Endpoint DocumentationSinger taps describe the data that a stream supports via a Discovery process. You can run the Dayforce tap in Discovery mode by passing the --discover
flag at runtime:
$ ~/.venvs/tap-holidays/bin/tap-holidays --config=config/holidays.config.json --discover
The tap will generate a Catalog to stdout. To pass the Catalog to a file instead, simply redirect it to a file:s
$ ~/.venvs/tap-holidays/bin/tap-holidays --config=config/holidays.config.json --discover > catalog.json
Running a tap in Sync mode will extract data from the various selected Streams. In order to run a tap in Sync mode and have messages emitted to stdout, pass a valid configuration file and catalog file:
$ ~/.venvs/tap-holidays/bin/tap-holidays --config=config/holidays.config.json --catalog=catalog.json
The tap will emit occasional Metric, Schema, Record, and State messages. You can persist State between runs by redirecting messages to a file:
$ ~/.venvs/tap-holidays/bin/tap-holidays --config=config/holidays.config.json --catalog=catalog.json >> state.json
$ tail -1 state.json > state.json.tmp
$ mv state.json.tmp state.json
You can also send the output of the tap to Stitch Data for loading into the data warehouse. To do this, first create a JSON-formatted configuration for Stitch. This configuration file has two required fields:
client_id
: The ID associated with the Stitch Data account you'll be sending data to.token
The token associated with the specific Import API integration within the Stitch Data account.An example configuration file will look as follows:
{
"client_id": 1234,
"token": "foobarfoobar"
}
Once the configuration file is created, simply pipe the output of the tap to the Stitch Data target and supply the target with the newly created configuration file:
$ ~/.venvs/tap-holidays/bin/tap-holidays --config=config/dayforce.config.json --catalog=catalog.json --state=state.json | ~/.venvs/target-stitch/bin/target-stitch --config=config/stitch.config.json >> state.json
$ tail -1 state.json > state.json.tmp
$ mv state.json.tmp state.json
The first step to contributing is getting a copy of the source code. First, fork tap-holidays
on GitHub. Then, cd
into the directory where you want your copy of the source code to live and clone the source code:
$ git clone git@github.com:YourGitHubName/tap-holidays.git
Now that you have a copy of the source code on your local machine, you can leverage Pipenv and the corresponding Pipfile
to install of the development dependencies within a virtual environment:
$ pipenv install --three --dev
This command will create an isolated virtual environment for your tap-holidays
project and install all the development dependencies defined within the Pipfile
inside of the environment. You can then enter a shell within the environment:
$ pipenv shell
Or, you can run individual commands within the environment without entering the shell:
$ pipenv run <command>
For example, to format your code using isort and flake8 before commiting changes, run the following commands:
$ pipenv run make isort
$ pipenv run make flake8
You can also run the entire testing suite before committing using tox:
$ pipenv run tox
Finally, you can run your local version of the tap within the virtual environment using a command like the following:
$ pipenv run tap-holidays --config=config/dayforce.config.json --catalog=catalog.json
Once you've confirmed that your changes work and the testing suite passes, feel free to put out a PR!
FAQs
Singer.io tap for extracting data from Holidays API.
We found that tap-holidays 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.