Skip to main content

Python Sync Dotenv is a Python package for synchronizing .env files across projects.

Project description

https://img.shields.io/pypi/pyversions/py-sync-dotenv?style=plastic:target:https://pypi.python.org/pypi/py-sync-dotenv https://img.shields.io/travis/com/IamAbbey/py_sync_dotenv?style=plastic:target:https://travis-ci.com/github/IamAbbey/py_sync_dotenv https://img.shields.io/readthedocs/py-sync-dotenv/latest?style=plastic:target:https://py-sync-dotenv.readthedocs.io/en/latest/:alt:DocumentationStatus

Python Sync Dotenv is a Python package for synchronizing .env files across projects using command-line interfaces.

Installation

$ pip install py-sync-dotenv

Usage

  • By default, py-sync-dotenv tries to locate the source .env file with the name .env from the current working directory.

    $ py-sync-dotenv
  • This behavior can be modified by providing the source .env file path using the -s, --source option.

    $ py-sync-dotenv -s .env.source
    
    #OR
    
    $ py-sync-dotenv --source .env.source
  • Another option that can be supplied is the -d, --destination-env which is used to provide the path to the destination .env file. The below commands synchronizes the source .env file with the specified destination env file - .env.dev

    $ py-sync-dotenv -d .env.dev
    
    #OR
    
    $ py-sync-dotenv --destination-env .env.dev``
  • Likewise, there is the -ds, --destination-envs option which is used to provide the directory containing the destination .env file(s). The below commands synchronizes the source .env file with all the .env files contained in the specified directory.

    $ py-sync-dotenv -ds dev_envs/
    
    #OR
    
    $ py-sync-dotenv --destination-envs dev_envs/``
  • Futhermore, to all the above options, you can specify the --just-variable flag to indicates to the engine to synchronize just the variables.

    $ py-sync-dotenv -d .env.dev --just-variables
    
    # Source --------------------> destination
    
    # SQL_HOST=127.0.0.1 --------> SQL_HOST=
    
    # SQL_PORT=5432 --------> SQL_PORT=

Command

  • The watch command can be used to auto synchronize the source .env file [on file changed/modified] with the specified destination file(s).

    $ py-sync-dotenv -s .env.source -d .env.dev watch
  • Coupled with the watch command is the --show-logs flag, which is used to show file changes logs as they occur.

    $ py-sync-dotenv -d .env.dev watch --show-logs

Options

Type

Option

Description

FILE

-s, –source

Source .env file to use in populating other .env files [default: .env].

FILE

-d, –destination-env

.env file for destination stage.

DIRECTORY

-ds, –destination-envs

Directory path to .env files for destination stage.

Flags

Type

Flag

Description

FLAG

–just-variables

indicates to the engine to synchronize just the variables.

FLAG

–show-logs

show file changes logs as they occur. To be used with the watch command

FLAG

–help

Show this message and exit.

Commands

Type

Command

Description

COMMAND

watch

indicates to the engine to auto synchronize the source .env file [on file changed/modified] with the specified destination file(s).

Credits

This package was created with Cookiecutter and the cookiecutter-pypackage project template.

History

0.1.0 (2021-03-19)

  • First release on PyPI.

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

py_sync_dotenv-0.1.3.tar.gz (12.9 kB view details)

Uploaded Source

Built Distribution

py_sync_dotenv-0.1.3-py2.py3-none-any.whl (6.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file py_sync_dotenv-0.1.3.tar.gz.

File metadata

  • Download URL: py_sync_dotenv-0.1.3.tar.gz
  • Upload date:
  • Size: 12.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.13

File hashes

Hashes for py_sync_dotenv-0.1.3.tar.gz
Algorithm Hash digest
SHA256 4d33bf872390aeb2db732e5b8e2ea06a65cec9b5dbea00a6d6ffce8c0056d665
MD5 5da6600fa0617735a35c4dc35e1df1a8
BLAKE2b-256 a85f15062a542a578e263854f3fa63411f9249697026884a0126d46af6e312c4

See more details on using hashes here.

File details

Details for the file py_sync_dotenv-0.1.3-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for py_sync_dotenv-0.1.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 fe27c9b05661752a97ef4f2157d7d2dc87a490b3481cc760619bf0a5d8b91ae1
MD5 5aac9e3f68a0470e22530e6178c0c155
BLAKE2b-256 62c5d957f8e9baac2e4f0a6d0313668b9b6d943f9fd8dd223f49115dc9914063

See more details on using hashes here.

Supported by

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