{"id":20003207,"url":"https://github.com/mbrsagor/notepad","last_synced_at":"2026-02-16T00:31:08.771Z","repository":{"id":52455177,"uuid":"275208654","full_name":"mbrsagor/notepad","owner":"mbrsagor","description":"Python flask notepad API services backend web app","archived":false,"fork":false,"pushed_at":"2025-03-24T05:02:50.000Z","size":483,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-04T15:41:26.991Z","etag":null,"topics":["api-rest","flask","python3"],"latest_commit_sha":null,"homepage":"https://github.com/mbrsagor/notepad","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/mbrsagor.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-06-26T17:13:17.000Z","updated_at":"2025-03-24T05:02:48.000Z","dependencies_parsed_at":"2023-01-26T21:50:11.621Z","dependency_job_id":"d80c510f-2ed3-440e-9007-509a79b3250b","html_url":"https://github.com/mbrsagor/notepad","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mbrsagor/notepad","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrsagor%2Fnotepad","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrsagor%2Fnotepad/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrsagor%2Fnotepad/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrsagor%2Fnotepad/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mbrsagor","download_url":"https://codeload.github.com/mbrsagor/notepad/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrsagor%2Fnotepad/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29494975,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T00:16:34.147Z","status":"ssl_error","status_checked_at":"2026-02-16T00:15:26.759Z","response_time":118,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["api-rest","flask","python3"],"created_at":"2024-11-13T05:24:37.577Z","updated_at":"2026-02-16T00:31:08.757Z","avatar_url":"https://github.com/mbrsagor.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Notepad\n\n\u003e The notepad app for daily note for everyone flask API based service application which the api will use mobile application.\n\n#### Installation to local or production server.\n\n###### Setup\n```bash\ngit clone https://github.com/mbrsagor/notepad.git\ncd notepad\nvirtualenv venv --python=python3.12\nsource venv/bin/activate\n```\n\n##### Run:\n```bash\npython run app.py\n```\n\n#### Manual db migration\n```bash\nflask shell\nfrom app import db\ndb.create_all() \n```\n\n###### Resources:\n```bash\nhttps://flask-sqlalchemy.palletsprojects.com/en/2.x/quickstart/\n```\n\n##### ``Flask shell``:\n```python\nfrom app import NoteModel\nnote = NoteModel.query.all()\n```\n\n###### Stripe payment added\n```python\n\"\"\"\nserver.py\nStripe Sample.\nPython 3.10 or newer required.\n\"\"\"\nimport os\nfrom flask import Flask, redirect, request\n\nimport stripe\n# This is your test secret API key.\nstripe.api_key = 'sk_test_51N2ynICoxSZeQbCGXEpJaIFFZJtfailSh2lQbMcXjI5tFSKS7HWjtawJjqobhqHjpHRK5bQAt1Si8E4zZFyZfuzC00lM275h7a'\n\napp = Flask(__name__,\n            static_url_path='',\n            static_folder='public')\n\nYOUR_DOMAIN = 'http://localhost:4242'\n\n@app.route('/create-checkout-session', methods=['POST'])\ndef create_checkout_session():\n    try:\n        checkout_session = stripe.checkout.Session.create(\n            line_items=[\n                {\n                    # Provide the exact Price ID (for example, pr_1234) of the product you want to sell\n                    'price': '{{PRICE_ID}}',\n                    'quantity': 1,\n                },\n            ],\n            mode='payment',\n            success_url=YOUR_DOMAIN + '/success.html',\n            cancel_url=YOUR_DOMAIN + '/cancel.html',\n        )\n    except Exception as e:\n        return str(e)\n\n    return redirect(checkout_session.url, code=303)\n\nif __name__ == '__main__':\n    app.run(port=4242)\n```\n\n\n```python\ntry:\n    response = requests.get('http://api.open-notify.org/astros.json', timeout=5)\n    response.raise_for_status()\n    # Code here will only run if the request is successful\nexcept requests.exceptions.HTTPError as errh:\n    print(errh)\nexcept requests.exceptions.ConnectionError as errc:\n    print(errc)\nexcept requests.exceptions.Timeout as errt:\n    print(errt)\nexcept requests.exceptions.RequestException as err:\n    print(err)\n```\n\n\u003e Celery task\n\n```bash\npip install celery\n```\n\n\u003e A Celery worker must be running to run the task. Starting a worker is shown in the previous sections.\n```python\nfrom flask import request\n@app.post(\"/add\")\ndef start_add() -\u003e dict[str, object]:\n    a = request.form.get(\"a\", type=int)\n    b = request.form.get(\"b\", type=int)\n    result = add_together.delay(a, b)\n    return {\"result_id\": result.id}\n```\n\n\u003e Here’s an example task that adds two numbers together and returns the result.\n```bash\nfrom celery import shared_task\n\n@shared_task(ignore_result=False)\ndef add_together(a: int, b: int) -\u003e int:\n    return a + b\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbrsagor%2Fnotepad","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmbrsagor%2Fnotepad","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbrsagor%2Fnotepad/lists"}