{"id":13688760,"url":"https://github.com/makramkd/pastebin","last_synced_at":"2026-04-13T06:49:01.056Z","repository":{"id":38962190,"uuid":"251399405","full_name":"makramkd/pastebin","owner":"makramkd","description":"A simple implementation of a Pastebin-type service","archived":false,"fork":false,"pushed_at":"2022-12-08T03:57:28.000Z","size":51,"stargazers_count":1,"open_issues_count":7,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-12T12:48:42.893Z","etag":null,"topics":["async","asyncio","docker","json","pastebin","postgresql","python","redis"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/makramkd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-30T18:52:28.000Z","updated_at":"2022-12-01T22:46:16.000Z","dependencies_parsed_at":"2022-08-26T02:05:47.368Z","dependency_job_id":null,"html_url":"https://github.com/makramkd/pastebin","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/makramkd%2Fpastebin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makramkd%2Fpastebin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makramkd%2Fpastebin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makramkd%2Fpastebin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/makramkd","download_url":"https://codeload.github.com/makramkd/pastebin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240127000,"owners_count":19751936,"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":["async","asyncio","docker","json","pastebin","postgresql","python","redis"],"created_at":"2024-08-02T15:01:21.926Z","updated_at":"2026-04-13T06:48:56.010Z","avatar_url":"https://github.com/makramkd.png","language":"Python","readme":"# Pastebin\n\nA simple implementation of a Pastebin-type service. If you're unfamiliar with what Pastebin is,\nsee [pastebin.com](https://pastebin.com/).\n\nThis is mostly done for learning and fun. It isn't production ready!\n\n# Architecture Diagram\n\n![](arch_diagram.png)\n\n# Building\n\nYou can build everything using [Docker](https://www.docker.com/).\n\nTo build the Pastebin image:\n\n```bash\n# Inside top level directory\ndocker build -t pastebin-dev -f Dockerfile .\n```\n\nTo build the database image:\n\n```bash\n# Inside the db/ directory\ndocker build -t pastebin-pg -f Dockerfile .\n```\n\nOr, if you'd rather use `docker-compose`:\n\n```bash\n# Inside top level directory\ndocker-compose up --build\n```\n\nFor local development, you can do:\n\n```bash\n# Ensure python 3\npyenv local 3.6.3 # or whichever version you like (3.6+ only)\npython -m venv .venv\nsource .venv/bin/activate\npip install -r requirements.txt\n```\n\n# Tests\n\nRun unit tests via:\n\n```bash\npython setup.py test\n```\n\n# API\n\nThe API is intentionally kept very simple.\n\n## `GET /api/v1/pastes/\u003cshortlink\u003e`\n\nGet the contents of a paste from the given shortlink. If the paste doesn't exist,\na 404 Not Found status code is returned. If the paste exists, it will be returned\nin the following JSON body:\n\n```javascript\n{\n  \"paste_content\": \"hello world! this is my first paste and i'm loving it!\"\n}\n```\n\n## `POST /api/v1/pastes`\n\nCreate a new paste. The request body must be JSON, with the following form:\n\n```javascript\n{\n  \"paste_content\": \"string\",\n  \"time_to_live\": 12345, // optional, time to live of the paste in seconds\n}\n```\n\nIf a time to live isn't given the paste will never expire. Otherwise, the paste\nwill be set to expired - and will no longer be accessible - after the specified time\nhas passed.\n\n# Still To Do\n\n* Implement paste expiry using Redis queues (DONE)\n* Unit tests of async behavior\n* Integration tests of system\n* Add docstrings to API, classes, and functions\n","funding_links":[],"categories":["docker"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakramkd%2Fpastebin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmakramkd%2Fpastebin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakramkd%2Fpastebin/lists"}