semvec/pypi-packages huggingface dataset:
terrier 0.1.dev3
UNKNOWN
License: MIT

## Terrier

Terrier is a helper for Terraform remote configuration. It allows `terraform remote` configurations to be stored in a JSON file and used between developers reliably. Currently Terraform doesn't support meta-configuration of itself or its remotes. This makes usage of `terraform remote` problematic as lengthy commands need to remembered or be disseminated through a `README` or other error prone methods.

## Usage

### Define a `terrier.json` configuration file

```
{
  "qa": {
    "remote": {
      "backend": "S3",
      "config": {
        "bucket": "foo-qa-bucket",
        "key": "foo-qa.tfstate",
        "region": "us-west-1"
      }
    }
  }
}
```

The top level key provides the name of an environment, `qa` in the following example. Keys generally map to `terraform remote config` arguments. Keys and values defined under `config` will be passed through as `-backend-config` arguments.

### Run `terrier remote <environment>`

The example above would be called with

`terrier remote qa`

and would generate and execute the following `terraform remote` command

`terraform remote config -backend=S3 -backend-config="bucket=foo-qa-bucket" -backend-config="key=foo-qa.tfstate" -backend-config="region=us-west-1"`

### Continue with `terraform remote`

`terrier` only handles configuration of multiple `terraform` remotes. Once run and a remote configured, one should carry on using vanilla `terraform remote pull` and `push` commands.
fillmydb 0.1.0
Fill your database with mocked instances.
License: MIT

fillmydb
========

Fill your database with mocked instances.

Wrap you ORM model into a `ModelWrapper`, specify how your fields should look
like and then generate how many instances you want of each model.


Installation
------------

- `pip install fillmydb[peewee]` if you plan to use it with peewee models
- `pip install fillmydb[django]` if you plan to use it with djanog models **(not implemented yet)**
- `pip install fillmydb[sqlalchemy]` if you plan to use it with sqlalchemy models **(not implemented yet)**


Usage with `fake-factory <https://github.com/joke2k/faker>`_
------------------------------------------------------------


Generating instances for a single model::

    import faker

    factory = faker.Factory.create()

    wrapper = ModelWrapper(TestModel)

    wrapper[TestModel].client_name = FieldSpec(factory.name)
    wrapper[TestModel].description = FieldSpec(factory.text)
    wrapper[TestModel].password_hash = FieldSpec(factory.binary, length=25)
    wrapper[TestModel].email = FieldSpec(factory.email)
    wrapper[TestModel].visits = FieldSpec(factory.pyint)

    item = wrapper.generate(100)


Generating instances for multipe models::

    from tests.models import User, Post, Like
    import faker

    factory = faker.Factory.create()

    wrapper = ModelWrapper(User, Like, Post)

    wrapper[User].name = FieldSpec(factory.name)
    wrapper[User].username = FieldSpec(factory.user_name)
    wrapper[User].description = FieldSpec(factory.text)
    wrapper[User].password_hash = FieldSpec(factory.binary, length=25)
    wrapper[User].email = FieldSpec(factory.email)
    wrapper[User].visits = FieldSpec(factory.pyint)

    wrapper[Post].title = FieldSpec(lambda _: "test", 1)
    wrapper[Post].text = FieldSpec(factory.text)

    # generating 10 users, 100 likes and 20 posts 
    wrapper.generate(10, 100, 20)

General workflow
----------------

Pseudo-code::

    initial_to_order_queue()
    while models_to_process():
        model = get_next_model()

        if model.has_unresolved_dependency():
            push_back_to_queue(model)

        # process model
        for _ in range(number_of_instances):
            for field in model.fields():
                # resolve_field(field)
                if field == ForeignKey:
                    field = get_random_ref_model_instance()
                else:
                    field = resolve_normal()
        mark_as_processed(model)