Skip to main content
 ____        _        _       _          ____            _       _ 
|  _ \  __ _| |_ __ _| | __ _| | _____  / ___|  ___ _ __(_)_ __ | |_ ___
| | | |/ _` | __/ _` | |/ _` | |/ / _ \ \___ \ / __| '__| | '_ \| __/ __|
| |_| | (_| | || (_| | | (_| |   <  __/  ___) | (__| |  | | |_) | |_\__ \
|____/ \__,_|\__\__,_|_|\__,_|_|\_\___| |____/ \___|_|  |_| .__/ \__|___/
                                                          |_|

How to use

Datalake scripts is developed by Datalake developers to help use the Datalake API

You can use this repository either as a library or as a CLI

Installation

With Python 3.8+:

$ pip install datalake-scripts
$ pip3 install datalake-scripts

Using as a library

The library requires to first create a Datalake instance and then to use the defined Classes' methods

The library tutorial is available in the following link

Example :

from datalake import Datalake, AtomType, Output

dtl = Datalake(username='username', password='password')
dtl.Threats.lookup(
    atom_value='mayoclinic.org',
    atom_type=AtomType.DOMAIN,
    hashkey_only=False,
    output=Output.JSON
)

Using as a CLI

The cli can be used with:

$ ocd-dtl <command> <parameter>

Check ocd-dtl -h for help, including the list of commands available.

You can also use a script directly by using the following command: <script_name> <script_options>.

/!\ Make sure to use utf-8 without BOM when providing a file as input (-i, --input parameter)

Cli parameters

Common parameters for all commands:

  • -e, --env <preprod|prod> : Datalake environment. Default is prod
  • -o, --output <OUTPUT_PATH> : will set the output file as the API gives it. No default
  • -D, --debug : will raise the verbosity of the program (by displaying additional DEBUG messages). Default log level is INFO
  • -q, --quiet : will quiet the verbosity of the program (but will still show ERROR / WARNING messages). Default log level is INFO

Commands can also have additionary mandatory or optional parameters

For information about each command and more, please check the documentation directory

Environment variables

Authentication

There are two methods of authentication:

  • The first one is the use of the username and password. Every request to the API, will then use fresh tokens periodically created with these credentials.
  • The second one is the use of a long term token. You can create long term token through the GUI, it can have more restricted permissions than your account. You can create several long term tokens for one account.

In case you don't want to enter credentials for each commands and you are on a secured terminal, set those variables:

  • OCD_DTL_LONGTERM_TOKEN a long term token associated to your Datalake account. Please note that if this variable is set, then the long term token will be used for every request to the Datalake API, even if you set the username and passsword environment variables below. This is important because some endpoints / requests do not accept long term tokens but need fresh tokens (ie a Datalake instance with username and password). Check for the need of fresh tokens in each endpoint description here

or

  • OCD_DTL_USERNAME email address used to login on Datalake API/GUI.
  • OCD_DTL_PASSWORD password used to login on Datalake API/GUI.

These last two are independent and one can be used without the other if you wish.

Using a Proxy

You can set up following environment variables :

  • HTTP_PROXY
  • HTTPS_PROXY

We use the format accepted by the requests python library. See its documenation for other possible kinds of proxy to set up.

Throttling and retries

For throttling the requests, those two environment variables can be used:

  • OCD_DTL_QUOTA_TIME defines, in seconds, the time before resetting the requests limit, default is 1 second.
  • OCD_DTL_REQUESTS_PER_QUOTA_TIME defines the number of request to do at maximum for the given time, default is 5 queries. We recommend to lower the OCD_DTL_REQUESTS_PER_QUOTA_TIME value, if you encounter too many 429 errors.

Please don't exceed the quota marked here for each endpoint

Only network errors and HTTP response code 429, 500, 502, 503 and 504 trigger retries. You may control the number of retries using the environment variable OCD_DTL_MAX_RETRIES, which defaults to 3.

Contributing

To develop on this repository, please refer to this file

Metadata

Release files for datalake-scripts 3.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for datalake-scripts 3.1.1
File Size Uploaded Provenance Actions
datalake_scripts-3.1.1.tar.gz 45.8 kB With provenance Details for datalake_scripts-3.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for datalake-scripts 3.1.1
File Interpreter ABI Platform Actions
datalake_scripts-3.1.1-py3-none-any.whl Python 3 none any Details for datalake_scripts-3.1.1-py3-none-any.whl

Total release size: 114.1 kB

Release files / datalake_scripts-3.1.1.tar.gz

Download URL datalake_scripts-3.1.1.tar.gz
Size 45.8 kB
Tags Source
SHA-256 checksum
How to use checksums
5b968f57ecb975ee3099028091b8a028e3c2352b387d8c59db256682dd2b657f
BLAKE2b-256 checksum
How to use checksums
f67de552cd92821f33bcbe091c6b7042c816a1ca5e354482761a931e4582ea56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Release files / datalake_scripts-3.1.1-py3-none-any.whl

Download URL datalake_scripts-3.1.1-py3-none-any.whl
Size 68.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f2a6d1e03109b957ba5f5ed09b058f753f61a1fc3b70fab1ffd42b58b099dee3
BLAKE2b-256 checksum
How to use checksums
9f30e9f125ec59e61a357a01afc1608ad41a0d23ad7876a4b2b900a8b074345b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Security for datalake-scripts 3.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for datalake_scripts-3.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

3.1.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page