Upgrade to Pro — share decks privately, control downloads, hide ads and more …

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.

94ccb677ee0280018e84e0d12e213c4d?s=128

James Robert

August 15, 2015
Tweet

Transcript

  1. WHY DOESN’T ANYONE USE MY LIBRARY?

  2. OR…

  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.
  4. None
  5. @JIAARO

  6. WHY DOESN’T ANYONE USE MY LIBRARY?

  7. 3 REASONS

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

  9. 3 REASONS 1. They’ve never heard of it 2. It

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

    doesn’t fit their needs 3. Using something else instead
  11. STORY TIME

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

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

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

    “rb”).read() combined = sound1 + sound2
  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”)
  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)
  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)
  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()
  19. None
  20. RE-EVALUATE MY DECISIONS AND/OR LIFE

  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)
  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()
  23. None
  24. None
  25. None
  26. 3 REASONS 1. They’ve never heard of it 2. It

    doesn’t fit their needs 3. Using something else instead
  27. 3. THEY’RE USING SOMETHING ELSE

  28. 3. THEY’RE USING SOMETHING ELSE ▸ What are people using

    now? ▸ What are the criticisms? ▸ What do they like?
  29. A GOOD API is worth it

  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”)
  31. Opportunity is missed by most people because it is dressed

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

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

    in overalls and looks like work. ▸ Anonymous
  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
  35. Showing up is 80 percent of life. ▸ Woody Allen

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

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

  38. None
  39. BUILD Libraries, NOT FRAMEWORKS

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

  43. None
  44. None
  45. 1. Github 2. Stack Overflow: pydub tag via RSS 3.

    PyPI: for pip install
  46. GITHUB ▸ octopress: Barebones landing page ▸ issues: Bugs/Features ▸

    docs: markdown files in the repo ▸ AUTHORS file: has my email and twitter
  47. 1. Github 2. Stack Overflow: pydub tag via RSS 3.

    PyPI: for pip install
  48. THE LONG HAUL

  49. DON’T FORGET ABOUT YOUR RESEARCH

  50. STORY TIME (CONTINUED)

  51. None
  52. LUCK

  53. RECAP

  54. RECAP ▸ Solve a real problem

  55. RECAP ▸ Solve a real problem ▸ Nice API

  56. RECAP ▸ Solve a real problem ▸ Nice API ▸

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

    Don’t overcommit ▸ Keep showing up
  58. THANKS! James Robert @jiaaro pydub.com pydub@jiaaro.com james@mediapredict.com