{"id":15105259,"url":"https://github.com/kmonika26/python-backend-assignment","last_synced_at":"2026-01-29T06:34:16.720Z","repository":{"id":257170232,"uuid":"857516597","full_name":"KMONIKA26/Python-Backend-Assignment","owner":"KMONIKA26","description":"This repository contains solutions to three tasks for a Python backend developer assignment. Each task is implemented as a stand-alone web application using Python frameworks and libraries such as Flask and Redis.","archived":false,"fork":false,"pushed_at":"2024-09-14T21:19:14.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-25T10:11:52.105Z","etag":null,"topics":["css3","flask","html5","python"],"latest_commit_sha":null,"homepage":"","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/KMONIKA26.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}},"created_at":"2024-09-14T21:12:19.000Z","updated_at":"2024-09-14T21:20:13.000Z","dependencies_parsed_at":"2024-09-15T05:46:31.936Z","dependency_job_id":"497e122f-0c9c-4afe-8abe-7cd85b4f3d6c","html_url":"https://github.com/KMONIKA26/Python-Backend-Assignment","commit_stats":null,"previous_names":["kmonika26/python-backend-assignment"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KMONIKA26%2FPython-Backend-Assignment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KMONIKA26%2FPython-Backend-Assignment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KMONIKA26%2FPython-Backend-Assignment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KMONIKA26%2FPython-Backend-Assignment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KMONIKA26","download_url":"https://codeload.github.com/KMONIKA26/Python-Backend-Assignment/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245989598,"owners_count":20705864,"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":["css3","flask","html5","python"],"created_at":"2024-09-25T20:22:24.820Z","updated_at":"2026-01-29T06:34:16.675Z","avatar_url":"https://github.com/KMONIKA26.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python Backend Developer Assignment\n\nThis repository contains solutions to three tasks for a Python backend developer assignment. Each task is implemented as a stand-alone web application using Python frameworks and libraries such as Flask and Redis.\n\n## Table of Contents\n\n1. [Task 1: URL Shortener](#task-1-url-shortener)\n2. [Task 2: PasteLockly](#task-2-pastelockly)\n3. [Task 3: Nifty 50 Web Scraper](#task-3-nifty-50-web-scraper)\n4. [Technologies Used](#technologies-used)\n5. [Setup Instructions](#setup-instructions)\n6. [File Structure](#file-structure)\n7. [Future Enhancements](#future-enhancements)\n8. [License](#license)\n\n---\n\n## Task 1: URL Shortener\n\nThis task implements a URL shortener web app. Users can submit a long URL through a form, and the app generates a short URL for it. When the short URL is accessed, the user is redirected to the original URL.\n\n### Features\n\n1. **Create Short URLs**: Users can submit long URLs and receive a short URL in return.\n2. **Redirection**: Accessing the short URL redirects users to the original URL.\n3. **Edge Case Handling**: Includes handling of invalid URLs and duplicate entries.\n4. **Optimizations**: Efficient space and time management for storing and retrieving URLs.\n\n---\n\n## Task 2: PasteLockly\n\nPasteLockly is a web app that allows users to share text snippets anonymously by creating a shareable URL. Users can also encrypt their snippets with a secret key, which will be required for viewing the content.\n\n### Features\n\n1. **Shareable Text Snippets**: Users can post text snippets and generate a shareable URL.\n2. **View-Only Snippets**: The generated URL allows only view access to the snippet.\n3. **Optional Encryption**: Users can add a secret key to encrypt the snippet, which will need to be provided to view it.\n4. **Secure Viewing**: The viewer must supply the correct secret key to decrypt and view the snippet.\n\n---\n\n## Task 3: Nifty 50 Web Scraper\n\nThis task implements a web app that scrapes stock market data (Nifty 50) from [NSE India](https://www.nseindia.com/) every 5 minutes. The scraped data is stored in Redis and displayed in a card layout.\n\n### Features\n\n1. **Scrape Nifty 50 Data**: Scrapes the Nifty 50 stock data from the NSE India website every 5 minutes.\n2. **Redis Storage**: Persists the scraped data in Redis for fast and efficient retrieval.\n3. **Card Layout**: Displays the scraped stock data in a visually appealing card format.\n4. **Background Scheduling**: A background task automatically scrapes the data at 5-minute intervals.\n\n---\n\n## Technologies Used\n\n- **Flask**: Lightweight Python web framework for building the backend of all three tasks.\n- **Redis**: In-memory data structure store used in Task 3 for caching the scraped data.\n- **BeautifulSoup**: Used for parsing HTML content from the NSE India website in Task 3.\n- **Requests**: For making HTTP requests in the Nifty 50 web scraper.\n- **APScheduler**: Schedules the background task to scrape data every 5 minutes in Task 3.\n- **HTML5 + CSS3**: Used to build user-friendly interfaces for each task.\n- **SQLite (or similar)**: Can be used for URL and text storage in Task 1 and Task 2.\n\n---\n\n## Setup Instructions\n\n### 1. Clone the Repository\n\n```bash\ngit clone https://github.com/your-username/python-backend-assignment.git\ncd python-backend-assignment\n```\n\n### 2. Install Dependencies\n\nInstall the necessary Python packages for all tasks:\n```bash\npip install Flask requests beautifulsoup4 redis apscheduler\n```\n\n### 3. Start Redis\n\nEnsure Redis is installed and running for Task 3:\n```bash\n# For Ubuntu:\nsudo apt-get install redis-server\nredis-server\n```\n\n### 4. Run Each Task\n\nYou can run each task individually as a Flask app.\n\n#### To Run Task 1: URL Shortener\n```bash\ncd url_shortener\npython app.py\n```\nAccess the app in your browser at `http://127.0.0.1:5000`.\n\n#### To Run Task 2: PasteLockly\n```bash\ncd pastelockly\npython app.py\n```\nAccess the app in your browser at `http://127.0.0.1:5000`.\n\n#### To Run Task 3: Nifty 50 Web Scraper\n```bash\ncd nifty_scraper\npython web_scraper.py\n```\nAccess the app in your browser at `http://127.0.0.1:5000`.\n\n---\n\n## Future Enhancements\n\n### Task 1: URL Shortener\n- **Analytics**: Add tracking for how many times each shortened URL is accessed.\n- **Expiration**: Add expiration dates for shortened URLs.\n\n### Task 2: PasteLockly\n- **Expiration**: Allow users to set expiration times for the snippets.\n- **Snippet Versioning**: Add version control to view older versions of a snippet.\n\n### Task 3: Nifty 50 Web Scraper\n- **Data Visualization**: Add charts or graphs to better represent stock trends.\n- **Search and Filter**: Allow users to filter and search for specific stocks.\n- **Responsive Design**: Improve mobile responsiveness for the card layout.\n\n---\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkmonika26%2Fpython-backend-assignment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkmonika26%2Fpython-backend-assignment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkmonika26%2Fpython-backend-assignment/lists"}