{"id":18572343,"url":"https://github.com/nick-lehmann/sargilo","last_synced_at":"2025-04-10T07:31:16.518Z","repository":{"id":57463931,"uuid":"232423245","full_name":"nick-lehmann/Sargilo","owner":"nick-lehmann","description":" 💾 Data loader for Humans","archived":false,"fork":false,"pushed_at":"2020-03-30T16:30:50.000Z","size":78,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-24T18:05:14.971Z","etag":null,"topics":["django","python","testing","testing-tools"],"latest_commit_sha":null,"homepage":"https://testo.nicklehmann.sh/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nick-lehmann.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-07T21:45:22.000Z","updated_at":"2020-03-30T16:30:52.000Z","dependencies_parsed_at":"2022-09-05T05:30:29.356Z","dependency_job_id":null,"html_url":"https://github.com/nick-lehmann/Sargilo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nick-lehmann%2FSargilo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nick-lehmann%2FSargilo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nick-lehmann%2FSargilo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nick-lehmann%2FSargilo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nick-lehmann","download_url":"https://codeload.github.com/nick-lehmann/Sargilo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248176301,"owners_count":21060042,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["django","python","testing","testing-tools"],"created_at":"2024-11-06T23:05:58.505Z","updated_at":"2025-04-10T07:31:16.242Z","avatar_url":"https://github.com/nick-lehmann.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Sargilo \n=======\n\n💾 Data loader for Humans\n\nSargilo lets you declare your data in a visually pleasing and non-frustrating way and loads it into your environment of choice. YAML usage, validation and auto-completion help you get boring jobs done.\n\n💡 Motivation\n-------------\n\nThe idea for this project came from the testing I had to do at work. Surely, you will need sample data to test the project you currently work on. After some time, two ways how to approach this have been emerged:\n\n- Create a minimal and abstract data sample for each test or group of tests and test against those\n- Find a more comphrehensive data set that satisfies most of edge cases and only add to it in rare cases\n\nThere are of course advantages and disadvantages to both approaches. However, I prefer the second approach and think of it as telling a little story. I prefer this way since the dataset can be used as a fixture when running your application and after working on it for quite some time, you will get a feeling for the result a function should produce, making it easier to spot errors.\n\n📦 Install\n----------\n\n```bash\npip install sargilo\n```\n\nOr if you prefer an alternative installation method\n\n```bash\npoetry add sargilo\npipenv install sargilo\n```\n\n🔗 Integrations\n---------------\n\nTo know how to load your data, `sargilo` has to know how to deal with your framework or ORM of choice. While `sargilo` provides the interface and basic functionaly, the specifics on how to load the data are up to the integration. Currently, the following integrations are supported:\n\n- Django (ORM)\n\n📒 Examples\n-----------\n\n```python\n# models.py\nfrom django import models\nfrom django.contrib.auth.models import User\n\n\nclass Tag(models.Model):\n    name = models.CharField(max_length=255, blank=False, null=False)\n\nclass Post(models.Model):\n    title = models.CharField(max_length=255)\n    content = models.TextField()\n\n    tag = models.ForeignKey(\n        Tag,\n        verbose_name='Tag',\n        related_name='posts',\n        on_delete=models.PROTECT\n    )\n\n    author = models.ForeignKey(\n        User,\n        verbose_name='Author',\n        related_name='posts',\n        on_delete=models.PROTECT\n    )\n```\n\n```yaml\n# dataset.yaml\nauth:\n  users:\n    - \u0026Admin\n      username:     \"Admin\"\n      first_name:   \"Christoph\"\n      last_name:    \"Smaul\"\n      email:        \"christoph@mail.de\"\n      password:     \"very_secret\"\n      is_staff:      True\n      is_superuser:  True\n    - \u0026Editor\n      username:     \"Editor\"\n      first_name:   \"Wendy\"\n      last_name:    \"Lator\"\n      email:        \"wendy@mail.de\"\n      password:     \"very_secret\"\n      is_staff:      True\n      is_superuser:  False\n\n\nblog:\n  tags:\n    - \u0026TestTag\n      name: \"Test\"\n    - \u0026BlueTag\n      name: \"Blue\"\n  posts:\n    - title: \"Hello world\"\n      text: \"Lorem ipsum dolor amet sunt\"\n      tag: *TestTag\n      author: *Admin\n\n    - title: \"Just a test\"\n      text: \"This is just a test. This is just a test. This is just a test.\"\n      tag: *TestTag\n      author: *Editor\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnick-lehmann%2Fsargilo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnick-lehmann%2Fsargilo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnick-lehmann%2Fsargilo/lists"}