HackIndia Logo
HackathonsNewsSkillsGrowth
HackIndia LogoContact: +91 9910125804

General

  • Companies
  • Colleges
  • Board of Advisors
  • Brand Ambassadors
  • FAQ
  • Contact
  • Report a Bug

Hackathons

  • Upcoming Hackathons
  • Judges
  • Mentors
  • Partners
  • Participating Colleges
  • Testimonials

Resources

  • About Us
  • Branding
  • Latest News
  • Growth
  • Skills
  • Builders
  • Ecosystem
  • Forum
  • Ideas
  • Prompt Optimizer
  • Games

© 2026 HackIndia. All rights reserved.

Privacy PolicyTerms of ServiceCode of ConductSitemap

Build 2.139 · 05 Nov 2026, 10:27 UTC

    HackIndia
    HackathonsNewsInternshipsSkillsGrowthPro Perks
    PythonWorking towardsPython
    0%

    0 of 10 steps done · +100 XP · +50 SHARP when it is yours

    1. 1Think in Python data5 min · +10 XP · +5 SHARP
    2. 2Shape data with comprehensions4 min · +10 XP · +5 SHARP
    3. 3Write functions and modules4 min · +10 XP · +5 SHARP
    4. 4Use virtual environments cleanly4 min · +10 XP · +5 SHARP
    5. 5Read files and JSON5 min · +10 XP · +5 SHARP
    6. 6Call APIs from Python4 min · +10 XP · +5 SHARP
    7. 7Make it runnable by others4 min · +10 XP · +5 SHARP
    8. 8Submit your Python repo5 min · +10 XP · +5 SHARP
    9. The check10 questions, 7 to pass · +10 SHARP
    10. Hand in the taskA project that uses the skill
    11. Skill and certificate+100 XP · +50 SHARP
    Lesson 7 of 8 4 min

    Python

    Make it runnable by others

    • +10 XP for this lesson
    • +100 XP when the skill is proved
    • Nobody here has proved it yet
    In 30 seconds
    • Make your script run from a fresh clone with one clear command.
    • Add a requirements.txt and sample input so others can test fast.
    Avoid machine-specific paths, secrets, and hidden setup.
    Key point

    The one test

    A runnable repo passes the fresh clone test. Someone should be able to clone it, install dependencies, run one command, and see output.

    Do not assume they have your folder structure, API key file, or college laptop setup.

    What runnable means

    Your script already reads data and calls an API or mock API. Now make it usable by another builder, mentor, or recruiter.

    They should not need to message you on WhatsApp for missing files or commands.

    Your to-do

    Minimum repo shape

    Do each one yourself, then tap it to tick it off. The ticks are only a checklist for you: they are not marked or scored.

    0 of 5 done

    Example

    Simple file layout

    Keep the first version boring. Boring is easy to run during judging.

    ai-summary-tool/
      main.py
      requirements.txt
      README.md
      sample_input.json
      output/
        .gitkeep
    Example

    Requirements file

    requirements.txt is just a list of pip packages. Do not include Python standard library modules like json, os, csv, or pathlib.

    If you used requests to call an API, include it.

    requests==2.32.3
    python-dotenv==1.0.1
    Common mistake

    Avoid local paths

    A common bug is hardcoding paths like C:\Users\Aman\Desktop\data.json or /home/you/project/input.json. That only works on your laptop.

    Use paths relative to the script or accept a file path as a command-line argument.

    Example

    Accept input path

    This pattern lets anyone run your tool with their own file. It also works well with your sample file.

    import argparse
    import json
    from pathlib import Path
    
    parser = argparse.ArgumentParser(description="Process input data and write output")
    parser.add_argument("--input", default="sample_input.json", help="Path to input JSON")
    parser.add_argument("--output", default="output/result.json", help="Path to output JSON")
    args = parser.parse_args()
    
    input_path = Path(args.input)
    output_path = Path(args.output)
    output_path.parent.mkdir(parents=True, exist_ok=True)
    
    with input_path.open("r", encoding="utf-8") as f:
        data = json.load(f)
    
    result = {
        "items_read": len(data) if isinstance(data, list) else 1,
        "status": "processed"
    }
    
    with output_path.open("w", encoding="utf-8") as f:
        json.dump(result, f, indent=2)
    
    print(f"Wrote {output_path}")
    Tip

    Handle secrets safely

    If your real API needs a key, do not commit the key. Read it from an environment variable or a .env file, and commit a .env.example instead.

    For hackathon review, include a mock mode if possible. That lets judges run your repo without your paid or private key.

    # .env.example
    API_KEY=put_your_key_here
    
    # Run with a mock mode if your script supports it
    python main.py --input sample_input.json --output output/result.json --mock
    Your to-do

    Do this now

    Do each one yourself, then tap it to tick it off. The ticks are only a checklist for you: they are not marked or scored.

    0 of 5 done

    Quick check

    0 of 2 right
    1.Your friend clones your repo. What should they need to run your Python tool?
    2.Your script uses C:\Users\Me\Desktop\input.json. What is the best fix?

    Answer the quick check to finish this lesson.

    ← Lesson 6Skip to lesson 8 →
    Python
    Working towards
    Python +100 XP

    0 of 8 lessons done · proved by a project that uses the skill

    See the track