$30 off During Our Annual Pro Sale. View Details »

Why Doesn’t Anyone Use My Library?

Why Doesn’t Anyone Use My Library?

When, why, and how to open source code, and how to get it into real-world use. Lessons learned working on Pydub (audio for humans, a la requests). It's grown to incorporate contributions from around the world, over 1000 stars on GitHub and the nicest API you'll find this side of the DAC.

James Robert

August 15, 2015
Tweet

Other Decks in Technology

Transcript

  1. WHY DOESN’T
    ANYONE
    USE MY LIBRARY?

    View Slide

  2. OR…

    View Slide

  3. HOW TO BUILD SOMETHING USEFUL AND
    HELP IT GAIN ADOPTION BY NURTURING IT
    FOR YEARS AND NOT BITING OFF MORE THAN
    YOU CAN CHEW.

    View Slide

  4. View Slide

  5. @JIAARO

    View Slide

  6. WHY DOESN’T
    ANYONE
    USE MY LIBRARY?

    View Slide

  7. 3 REASONS

    View Slide

  8. 3 REASONS
    1. They’ve never heard of it

    View Slide

  9. 3 REASONS
    1. They’ve never heard of it
    2. It doesn’t fit their needs

    View Slide

  10. 3 REASONS
    1. They’ve never heard of it
    2. It doesn’t fit their needs
    3. Using something else instead

    View Slide

  11. STORY TIME

    View Slide

  12. THIS’LL BE EASY
    sound1 = open(“talking.wav”, “rb”).read()

    View Slide

  13. THIS’LL BE EASY
    sound1 = open(“talking.wav”, “rb”).read()
    sound2 = open(“music.mp3”, “rb”).read()

    View Slide

  14. THIS’LL BE EASY
    sound1 = open(“talking.wav”, “rb”).read()
    sound2 = open(“music.mp3”, “rb”).read()
    combined = sound1 + sound2

    View Slide

  15. THIS’LL BE EASY
    sound1 = open(“talking.wav”, “rb”).read()
    sound2 = open(“music.mp3”, “rb”).read()
    combined = sound1 + sound2
    out_f = open(“this_will_totally_work.???”, “wb”)

    View Slide

  16. THIS’LL BE EASY
    sound1 = open(“talking.wav”, “rb”).read()
    sound2 = open(“music.mp3”, “rb”).read()
    combined = sound1 + sound2
    out_f = open(“this_will_totally_work.MP3”, “wb”)
    out_f.write(combined)

    View Slide

  17. THIS’LL BE EASY
    sound1 = open(“talking.wav”, “rb”).read()
    sound2 = open(“music.WAV”, “rb”).read()
    combined = sound1 + sound2
    out_f = open(“this_will_totally_work.WAV”, “wb”)
    out_f.write(combined)

    View Slide

  18. THIS’LL BE EASY
    # coding: -*- utf-8 -*-
    import wave
    sound1 = wave.open(“talking.wav”, “rb”)
    sound2 = wave.open(“music.wav”, “rb”)
    out_f = wave.open(“this_will_totally_work.WAV”, “wb”)
    # Who even knows what this does ¯\_()_/¯
    out_f.setparams(sound1.getparams())
    # manual accounting ಠ_ಠ
    sound1_frames = sound1.getnframes()
    sound2_frames = sound2.getnframes()
    out_f.setnframes(sound1_frames + sound2_frames)
    out_f.writeframes(sound1.readframes(sound1_frames))
    out_f.writeframes(sound2.readframes(sound2_frames))
    out_f.close()

    View Slide

  19. View Slide

  20. RE-EVALUATE MY DECISIONS
    AND/OR LIFE

    View Slide

  21. THIS’LL BE EASY
    ▸ Channels (Mono, Stereo)
    ▸ Sample Rate (44.1 kHz, 48 kHz, 22,050 kHz, …0
    ▸ Bit depth (8 / 16 / 24 / 32 bit)

    View Slide

  22. THIS’LL BE EASY
    import wave
    import audioop
    sound1 = wave.open(“talking.wav”, “rb”)
    sound2 = wave.open(“music.wav”, “rb”)
    out_f = wave.open(“this_will_totally_work.WAV”, “wb”)
    sound1_frames = sound1.getnframes()
    sound2_frames = sound2.getnframes()
    sound1_data = sound1.readframes(sound1_frames)
    sound2_data = sound2.readframes(sound2_frames)
    sound2_data_converted, _ = audioop.ratecv(
    sound2_data,
    sound2.getsampwidth(),
    sound2.getnchannels(),
    sound2.getframerate(),
    sound1.getframerate(),
    None
    )
    out_f.setparams(sound1.getparams())
    out_f.setnframes(sound1_frames + sound2_frames)
    out_f.writeframes(sound1_data)
    out_f.writeframes(sound2_data_converted)
    out_f.close()

    View Slide

  23. View Slide

  24. View Slide

  25. View Slide

  26. 3 REASONS
    1. They’ve never heard of it
    2. It doesn’t fit their needs
    3. Using something else instead

    View Slide

  27. 3. THEY’RE USING
    SOMETHING ELSE

    View Slide

  28. 3. THEY’RE USING SOMETHING ELSE
    ▸ What are people using now?
    ▸ What are the criticisms?
    ▸ What do they like?

    View Slide

  29. A
    GOOD API
    is worth it

    View Slide

  30. from pydub import AudioSegment
    sound1 = AudioSegment.from_wav(“sound.wav”)
    sound2 = AudioSegment.from_mp3(“music.mp3”)
    combined = sound1.append(sound2, crossfade=1000)
    combined.export(“tada.mp3”, format=“mp3”)

    View Slide

  31. Opportunity is missed by most people because it is dressed in overalls
    and looks like work.
    ▸ Thomas Edison

    View Slide

  32. Opportunity is missed by most people because it is dressed in overalls
    and looks like work.
    ▸ Henry Dodd

    View Slide

  33. Opportunity is missed by most people because it is dressed in overalls
    and looks like work.
    ▸ Anonymous

    View Slide

  34. The successful man was out and on the job long before opportunity
    came a-knocking.
    And this same opportunity, by the way, is ofttimes disguised as hard
    work
    ▸ Anonymous

    View Slide

  35. Showing up is 80 percent of life.
    ▸ Woody Allen

    View Slide

  36. Showing up is 80 percent of life.
    ▸ Marshall Brickman

    View Slide

  37. Showing up is 80 percent of life.
    ▸ Woody Allen

    View Slide

  38. View Slide

  39. BUILD Libraries,
    NOT FRAMEWORKS

    View Slide

  40. View Slide

  41. View Slide

  42. DON’T BITE OFF MORE THAN
    YOU CAN CHEW

    View Slide

  43. View Slide

  44. View Slide

  45. 1. Github
    2. Stack Overflow: pydub tag via RSS
    3. PyPI: for pip install

    View Slide

  46. GITHUB
    ▸ octopress: Barebones landing page
    ▸ issues: Bugs/Features
    ▸ docs: markdown files in the repo
    ▸ AUTHORS file: has my email and twitter

    View Slide

  47. 1. Github
    2. Stack Overflow: pydub tag via RSS
    3. PyPI: for pip install

    View Slide

  48. THE LONG HAUL

    View Slide

  49. DON’T FORGET ABOUT YOUR
    RESEARCH

    View Slide

  50. STORY TIME
    (CONTINUED)

    View Slide

  51. View Slide

  52. LUCK

    View Slide

  53. RECAP

    View Slide

  54. RECAP
    ▸ Solve a real problem

    View Slide

  55. RECAP
    ▸ Solve a real problem
    ▸ Nice API

    View Slide

  56. RECAP
    ▸ Solve a real problem
    ▸ Nice API
    ▸ Don’t overcommit

    View Slide

  57. RECAP
    ▸ Solve a real problem
    ▸ Nice API
    ▸ Don’t overcommit
    ▸ Keep showing up

    View Slide

  58. THANKS!
    James Robert
    @jiaaro
    pydub.com
    [email protected]
    [email protected]

    View Slide