Soumettre la recherche
Mettre en ligne
Building CLIs that Click
•
0 j'aime
•
481 vues
Jason Myers
Suivre
PyNash presentation on building better CLIs
Lire moins
Lire la suite
Technologie
Signaler
Partager
Signaler
Partager
1 sur 29
Télécharger maintenant
Télécharger pour lire hors ligne
Recommandé
Enhance system transparency and truthfulness with request tracing
Enhance system transparency and truthfulness with request tracing
Sam Keen
The Future Of Web App Testing and How To Stop It
The Future Of Web App Testing and How To Stop It
hugs
Python Static Analysis Tools
Python Static Analysis Tools
Jason Myers
Selenium 2: The Future of Selenium is now!
Selenium 2: The Future of Selenium is now!
AutomatedTester
Selenium (1)
Selenium (1)
onlinemindq
Sakai10 Selenium Workshop
Sakai10 Selenium Workshop
coreyjack
Steps to write Selenium
Steps to write Selenium
Rohit Thakur
Selenium 2
Selenium 2
onlinemindq
Recommandé
Enhance system transparency and truthfulness with request tracing
Enhance system transparency and truthfulness with request tracing
Sam Keen
The Future Of Web App Testing and How To Stop It
The Future Of Web App Testing and How To Stop It
hugs
Python Static Analysis Tools
Python Static Analysis Tools
Jason Myers
Selenium 2: The Future of Selenium is now!
Selenium 2: The Future of Selenium is now!
AutomatedTester
Selenium (1)
Selenium (1)
onlinemindq
Sakai10 Selenium Workshop
Sakai10 Selenium Workshop
coreyjack
Steps to write Selenium
Steps to write Selenium
Rohit Thakur
Selenium 2
Selenium 2
onlinemindq
DDD on example of Symfony (SfCampUA14)
DDD on example of Symfony (SfCampUA14)
Oleg Zinchenko
Serverless in production, an experience report (LNUG)
Serverless in production, an experience report (LNUG)
Yan Cui
DevSecCon London 2017 - MacOS security, hardening and forensics 101 by Ben Hu...
DevSecCon London 2017 - MacOS security, hardening and forensics 101 by Ben Hu...
DevSecCon
Nodevember 2015
Nodevember 2015
Adam Baldwin
DevOps with Serverless
DevOps with Serverless
Yan Cui
Techniques for Preserving Scientific Software Executions: Preserve the Mess o...
Techniques for Preserving Scientific Software Executions: Preserve the Mess o...
12th International Conference on Digital Preservation (iPRES 2015)
Charla EHU Noviembre 2014 - Desarrollo Web
Charla EHU Noviembre 2014 - Desarrollo Web
Mikel Torres Ugarte
Serverless in Production, an experience report (cloudXchange)
Serverless in Production, an experience report (cloudXchange)
Yan Cui
2 Roads to Redemption - Thoughts on XSS and SQLIA
2 Roads to Redemption - Thoughts on XSS and SQLIA
guestfdcb8a
Cloud patterns applied
Cloud patterns applied
Lars Fronius
20201010 - Collabdays 2020 - Sandro Pereira - Power Automates: best practice...
20201010 - Collabdays 2020 - Sandro Pereira - Power Automates: best practice...
Sandro Pereira
WebCamp: Developer Day: DDD in PHP on example of Symfony - Олег Зинченко
WebCamp: Developer Day: DDD in PHP on example of Symfony - Олег Зинченко
GeeksLab Odessa
Data Encryption at Rest
Data Encryption at Rest
All Things Open
Azure from scratch part 4
Azure from scratch part 4
Girish Kalamati
[DSC Europe 22] Smart approach in development and deployment process for vari...
[DSC Europe 22] Smart approach in development and deployment process for vari...
DataScienceConferenc1
Julien Simon "Scaling ML from 0 to millions of users"
Julien Simon "Scaling ML from 0 to millions of users"
Fwdays
DN 2017 | Reducing pain in data engineering | Martin Loetzsch | Project A
DN 2017 | Reducing pain in data engineering | Martin Loetzsch | Project A
Dataconomy Media
PowerShell - Be A Cool Blue Kid
PowerShell - Be A Cool Blue Kid
Matthew Johnson
Network OS Code Coverage demo using Bullseye tool
Network OS Code Coverage demo using Bullseye tool
Vikram G Hosakote
The Dirty Little Secrets They Didn’t Teach You In Pentesting Class
The Dirty Little Secrets They Didn’t Teach You In Pentesting Class
Rob Fuller
Introduction to SQLAlchemy ORM
Introduction to SQLAlchemy ORM
Jason Myers
Filling the flask
Filling the flask
Jason Myers
Contenu connexe
Similaire à Building CLIs that Click
DDD on example of Symfony (SfCampUA14)
DDD on example of Symfony (SfCampUA14)
Oleg Zinchenko
Serverless in production, an experience report (LNUG)
Serverless in production, an experience report (LNUG)
Yan Cui
DevSecCon London 2017 - MacOS security, hardening and forensics 101 by Ben Hu...
DevSecCon London 2017 - MacOS security, hardening and forensics 101 by Ben Hu...
DevSecCon
Nodevember 2015
Nodevember 2015
Adam Baldwin
DevOps with Serverless
DevOps with Serverless
Yan Cui
Techniques for Preserving Scientific Software Executions: Preserve the Mess o...
Techniques for Preserving Scientific Software Executions: Preserve the Mess o...
12th International Conference on Digital Preservation (iPRES 2015)
Charla EHU Noviembre 2014 - Desarrollo Web
Charla EHU Noviembre 2014 - Desarrollo Web
Mikel Torres Ugarte
Serverless in Production, an experience report (cloudXchange)
Serverless in Production, an experience report (cloudXchange)
Yan Cui
2 Roads to Redemption - Thoughts on XSS and SQLIA
2 Roads to Redemption - Thoughts on XSS and SQLIA
guestfdcb8a
Cloud patterns applied
Cloud patterns applied
Lars Fronius
20201010 - Collabdays 2020 - Sandro Pereira - Power Automates: best practice...
20201010 - Collabdays 2020 - Sandro Pereira - Power Automates: best practice...
Sandro Pereira
WebCamp: Developer Day: DDD in PHP on example of Symfony - Олег Зинченко
WebCamp: Developer Day: DDD in PHP on example of Symfony - Олег Зинченко
GeeksLab Odessa
Data Encryption at Rest
Data Encryption at Rest
All Things Open
Azure from scratch part 4
Azure from scratch part 4
Girish Kalamati
[DSC Europe 22] Smart approach in development and deployment process for vari...
[DSC Europe 22] Smart approach in development and deployment process for vari...
DataScienceConferenc1
Julien Simon "Scaling ML from 0 to millions of users"
Julien Simon "Scaling ML from 0 to millions of users"
Fwdays
DN 2017 | Reducing pain in data engineering | Martin Loetzsch | Project A
DN 2017 | Reducing pain in data engineering | Martin Loetzsch | Project A
Dataconomy Media
PowerShell - Be A Cool Blue Kid
PowerShell - Be A Cool Blue Kid
Matthew Johnson
Network OS Code Coverage demo using Bullseye tool
Network OS Code Coverage demo using Bullseye tool
Vikram G Hosakote
The Dirty Little Secrets They Didn’t Teach You In Pentesting Class
The Dirty Little Secrets They Didn’t Teach You In Pentesting Class
Rob Fuller
Similaire à Building CLIs that Click
(20)
DDD on example of Symfony (SfCampUA14)
DDD on example of Symfony (SfCampUA14)
Serverless in production, an experience report (LNUG)
Serverless in production, an experience report (LNUG)
DevSecCon London 2017 - MacOS security, hardening and forensics 101 by Ben Hu...
DevSecCon London 2017 - MacOS security, hardening and forensics 101 by Ben Hu...
Nodevember 2015
Nodevember 2015
DevOps with Serverless
DevOps with Serverless
Techniques for Preserving Scientific Software Executions: Preserve the Mess o...
Techniques for Preserving Scientific Software Executions: Preserve the Mess o...
Charla EHU Noviembre 2014 - Desarrollo Web
Charla EHU Noviembre 2014 - Desarrollo Web
Serverless in Production, an experience report (cloudXchange)
Serverless in Production, an experience report (cloudXchange)
2 Roads to Redemption - Thoughts on XSS and SQLIA
2 Roads to Redemption - Thoughts on XSS and SQLIA
Cloud patterns applied
Cloud patterns applied
20201010 - Collabdays 2020 - Sandro Pereira - Power Automates: best practice...
20201010 - Collabdays 2020 - Sandro Pereira - Power Automates: best practice...
WebCamp: Developer Day: DDD in PHP on example of Symfony - Олег Зинченко
WebCamp: Developer Day: DDD in PHP on example of Symfony - Олег Зинченко
Data Encryption at Rest
Data Encryption at Rest
Azure from scratch part 4
Azure from scratch part 4
[DSC Europe 22] Smart approach in development and deployment process for vari...
[DSC Europe 22] Smart approach in development and deployment process for vari...
Julien Simon "Scaling ML from 0 to millions of users"
Julien Simon "Scaling ML from 0 to millions of users"
DN 2017 | Reducing pain in data engineering | Martin Loetzsch | Project A
DN 2017 | Reducing pain in data engineering | Martin Loetzsch | Project A
PowerShell - Be A Cool Blue Kid
PowerShell - Be A Cool Blue Kid
Network OS Code Coverage demo using Bullseye tool
Network OS Code Coverage demo using Bullseye tool
The Dirty Little Secrets They Didn’t Teach You In Pentesting Class
The Dirty Little Secrets They Didn’t Teach You In Pentesting Class
Plus de Jason Myers
Introduction to SQLAlchemy ORM
Introduction to SQLAlchemy ORM
Jason Myers
Filling the flask
Filling the flask
Jason Myers
Spanning Tree Algorithm
Spanning Tree Algorithm
Jason Myers
Introduction to Pandas
Introduction to Pandas
Jason Myers
SQLAlchemy Core: An Introduction
SQLAlchemy Core: An Introduction
Jason Myers
Generating Power with Yield
Generating Power with Yield
Jason Myers
Introduction to SQLAlchemy and Alembic Migrations
Introduction to SQLAlchemy and Alembic Migrations
Jason Myers
Diabetes and Me: My Journey So Far
Diabetes and Me: My Journey So Far
Jason Myers
Selenium testing
Selenium testing
Jason Myers
Coderfaire Data Networking for Developers
Coderfaire Data Networking for Developers
Jason Myers
Plus de Jason Myers
(10)
Introduction to SQLAlchemy ORM
Introduction to SQLAlchemy ORM
Filling the flask
Filling the flask
Spanning Tree Algorithm
Spanning Tree Algorithm
Introduction to Pandas
Introduction to Pandas
SQLAlchemy Core: An Introduction
SQLAlchemy Core: An Introduction
Generating Power with Yield
Generating Power with Yield
Introduction to SQLAlchemy and Alembic Migrations
Introduction to SQLAlchemy and Alembic Migrations
Diabetes and Me: My Journey So Far
Diabetes and Me: My Journey So Far
Selenium testing
Selenium testing
Coderfaire Data Networking for Developers
Coderfaire Data Networking for Developers
Dernier
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Miguel Araújo
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
Malak Abu Hammad
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
Paola De la Torre
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
The Digital Insurer
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
🐬 The future of MySQL is Postgres 🐘
🐬 The future of MySQL is Postgres 🐘
RTylerCroy
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Katpro Technologies
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
Safe Software
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
Sinan KOZAK
Slack Application Development 101 Slides
Slack Application Development 101 Slides
praypatel2
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
Rafal Los
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
Delhi Call girls
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Roshan Dwivedi
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
Martijn de Jong
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Neo4j
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
Delhi Call girls
Dernier
(20)
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
🐬 The future of MySQL is Postgres 🐘
🐬 The future of MySQL is Postgres 🐘
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
Slack Application Development 101 Slides
Slack Application Development 101 Slides
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
Building CLIs that Click
1.
BUILDING CLIS THAT CLICK Created
by /Jason A Myers @jasonamyers
2.
BUILDING GOOD COMMAND
LINE APPLICATIONS IS HARD
3.
IMPORTANT PARTS NAME ARGUMENT PARSING
AND VALIDATION * HELP GENERATION * COMMAND STRUCTURE * AUTOCOMPLETION NICE OUTPUT PACKAGING *
4.
ARGUMENTS AND HELP
5.
THREE DIFFERENT PARSERS
IN THE STDLIB getopt optparse argparse
6.
I MEAN ARGPARSE
IS THE NEW HOTNESS???
7.
SERIOUSLY WHO KNOWS
HOW *!@%PARSE WORKS ANYWAY
8.
NO REALLY HAVE
YOU LOOKED AT THE DOCS...
9.
10.
SERIOUSLY BRAIN CELLS
EXPLODE
11.
HOW BAD IS
IT? docopt Plac Cliff Clint
12.
import sys if __name__
== "__main__": main(sys.argv)
13.
14.
DEMO
15.
LOGGING
16.
GOOD LOGGING MESSAGES Time Module Level Parseable
Messages
17.
2015-05-28 09:25:18,711 -
complex.logger - DEBUG - Creating composit e: cookies 2015-05-28 09:25:18,711 - complex.logger - DEBUG - Created composite : cookies
18.
JAM'S LOGGING STYLE
19.
import logging logger =
logging.getLogger(__name__) logger.setLevel(logging.ERROR)
20.
file_log_handler = logging.FileHandler('complex-cli.log') logger.addHandler(file_log_handler) stderr_log_handler
= logging.StreamHandler() logger.addHandler(stderr_log_handler)
21.
format_string = '%(asctime)s
- %(name)s - ' '%(levelname)s - %(message)s' formatter = logging.Formatter(format_string) file_log_handler.setFormatter(formatter) stderr_log_handler.setFormatter(formatter)
22.
PACKAGING
23.
FIND OUR MODULE from
setuptools import setup, find_packages setup( name='complex', version='0.1.2', packages=find_packages(), include_package_data=True,
24.
install_requires=[ 'Click==3.3', ],
25.
description='A description', classifiers=[ 'License ::
OSI Approved :: BSD License', 'Programming Language :: Python', 'Programming Language :: Python :: 3', ],
26.
entry_points=''' [console_scripts] complex=complex.command:cli ''' )
27.
COMPLEX DEMO
28.
29.
QUESTIONS @JASONAMYERS
Télécharger maintenant