Add to Watchlist

Python for IT specialists' tasks automation

158 views

Citation of segment
Embed Code
Purchasing a DVD Cite video

Formal Metadata

Title Python for IT specialists' tasks automation
Title of Series EuroPython 2015
Part Number 169
Number of Parts 173
Author Nieri, Gianluca
License CC Attribution - NonCommercial - ShareAlike 3.0 Unported:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal and non-commercial purpose as long as the work is attributed to the author in the manner specified by the author or licensor and the work or content is shared also in adapted form only under the conditions of this license.
DOI 10.5446/20118
Publisher EuroPython
Release Date 2015
Language English
Production Place Bilbao, Euskadi, Spain

Content Metadata

Subject Area Computer Science
Abstract Gianluca Nieri - Python for IT specialists' tasks automation This talks is about automation and the use of Python scripts to speed up repetitive tasks. It's for developers, sysops, devops, but also any kind of user that want improve his daily routine. I will talk about the use of Python with different tools for different platforms: Keyboard Maestro/Alfred/Hazel on OsX and Synapse/Kupfer/AutoKey on Linux. There will be presented some sample script to give an idea of the potentiality of Python mixed with great tools, and these are some of the topics that I will cover: - text manipulation; - document template management; - clipboard management; - stuff internet activities (url shortening, web scraping, etc.); - list management. - etc.
Keywords EuroPython Conference
EP 2015
EuroPython 2015
Series
Annotations
Transcript
Loading...
there was I think the media and this part the presentation so 1st very
quickly which is the agenda for the next 30 minutes and we will talk about software automation using a different tools so especially working with scripting so we will see how to make so this tools we the Python and realize some interesting procedures to speed up our big job and this is not a sticky think of culture it's not for use only applied to but it's about using Python in different ways is is is we slides for doing whatever you want basically simplified our life and enhance our the ability to the presentation is divided in 2 parts the 1st is pure side where but I want to give you some concepts that amounts of through mission and the 2nd part
which the most of some example I found pretty interesting about the information so let's start with that need to from a set of many community
annotation Developer Technical writer the US architect probably of course I at heightened lover so I decided to give this toolkit and because muscle is a guy I decided to show you exactly how used by 2 4 of permitting rapidity and not so interesting task
when information 1st thing 1st at meeting of Parties task that has 3 main benefits the 1st of course is that the meeting task considered time you demand to a Python script or to a 3rd party and to learn the jobs and the frankly speaking in a good script is always faster than you at the past 2nd that he should write a script to automate the procedures are occurring job but once the best thing that you can be confident that the result is the court to resolve way you repeat the tasks that you can now in a narrow so doing these by using information is more and more and more and of course the key word here is testing because you will several ways to test and many times as you are confident that with the results of the Commission's and and 3rd ultimate helps you also to remain focus on what you're going if you make for example a procedure to reside information from the Internet that you don't have to leave that your ideal your main application and retrieve information but as you can type if you strings and they have that that the that without leaving it your main stream or or your main process the 2nd
question is when that 3 factors alone group policy there were committing task when you put when you a plan to automate best the 1st is the execution time so that when the test is takes time to execute is always a good time candidate for automation if you commit long passed every time you run it you save an incredible amount of time this 2nd factor is the frequency because of also passed that doesn't need there so much time can be automated if they are frequently during the day so consider the short amount of time and repeated by the number of times and run the task and you have always a good save time the 3rd visibility before accuracy show have varied and they can taste faster and you need to rely on them even if they are not the time-consuming reflected frequent you can consider permitting them so what can you tell me fundamentally whatever you want I summer idea saying giving to you some idea so string manipulation we we see later information driving you can automate the how can we tried to manipulate the and the reform they data and manipulation of major management and we'll see how it is possible to and easily manage in the majors for stationary size and whatever we want and also looking management because if you I used to produce both in the same documents with always more changes so you can automate and mixing of data inside the document and produce new document that as that can alone is not enough you need a convenient way to run a commission scripts and you need a convenient way to interact with them and get the results back shell is not a good candidate because honestly if the initial you need to leave your application already should that I that I actually have on the screen the remembering the name and the parameters of the scripts that were about tools and so on so I think that so I think that trend is terrible kind at this point you may think to write your own interact with straight but once again is a solution is weak because it takes time and you have to face different problems like for example software activation interaction with third-party the apps it could more integration
reading and writing to the clipboard management and so on so considering what approach very very weak
and we propose use the use of all 3rd departs were so and I will show you a more convenient way to interact with the permission escaped the use of the song
what are the schools I'm talking about and I divided this disposing in 3 categories the 1st the 1st category is a command line tools and the tools that are useful to lunch from on the Mac and so on without leaving a the application you are using it in for around this to was out of for example of of sense for us then but there are many different tools for each
class and they created the outcome command-line position and in the center of the screen and in which of the magic begins for so so you want to press Commission of keys activates the user interface and with only you want the 2nd class there are 6 expansion who sent to that doesn't have interface about that can extract your keyboard typing and there was something when a specific combination of past the history of the cells are present so we will show you later was possible for example to automate the link creation the time information from browser neural shortening and salt good and therefore the plaster in the end what that can fire action on the or state that at a particular moment when the system change generally when you put this findings full there you can trigger an action and these actions can do different things on the finest of the top put aside is folder at what's after doing the and a Mac user so I will show you the
was far less than the 1st part the the 1 in green but then I wrote this table where you can see that there are alternatives for Linux and Windows and the approach is quite the same so you have a command line utilities for alignments and Windows TexAFon tech suspension
DVDs for alignment and windows and file system 3 years for lines and for Windows and on because I wasn't able to find something similar
to for the approach is the same ones you think helpful to make that and once you
understand the which are the parameters and the best practice you need that you can develop the same script on the west and or on Linux and on Windows about online I will show you 2 tools such as that of that you were less than the you widening the same way as before offered for input management while a profitable Maestro for multiple management I will show you some examples so you can decide which is the best for you
and so the 1st good is our friend carriers some screenshot as it was before I offer these very where the point of this book that is very simple when you type combination of these opens a common alignment in the middle screen we'll see it in the name of the before that the next means and then you can type a command and something that which is the magic that diseases their workflow written in a different for example where you can find some input in this case the word Holman you can define the process or actions that need to to run this case are Python script and then you define and in the end of of which is generated correlation people my
stuff works in a similar way it doesn't work from company to be less graphic if there's a top down logic where you put blocks inside the workflow but it's quite the same you define the it trigger for the model for the workflow the Commission process can call the to fall and the the actions are exactly in the In this sequence with that of consequence circular that's
under it's so different from the previous 2 because you have to decide which is the abbreviation and in every application you type the is an abbreviation for example in the browser text boxes or in a text in your favorite IDE it fiacre this and the replace the string type and with the results of the states that a white coat Texas ponder last
but not least that we have so that works on as a workflow manager triggered by system In this example I defined full there that they have on my Mac code CNN and then define connection called uploading made cell every time I move defined inside this folder this action is 5 and the other 2 works the checks the fight with the sloppiness of the fall there is the right time and then execute the script in this example it ultimately takes the following I possibly due to the full check if you use an image file and then uploads it to my come to believe in the some ideas now
stuff with alive and then we can move to them apart and I divided in the day more and we show you in 3 categories representing the 3 main blocks of software commissioned posts and there we use see the common signpost except pensions and a permitted procedure using file system triggers so good that means which
from the 2 modes so 1st
example of is that for where every time the common in space by Alfred opens and this is before it's a common line that is conveniently placed in the middle with 3 Nordic and type for example that the from any government spending produced this output with all the information about my network how does this work in a very simple way if I open the workflow manager in our
friends you can see the inflections which is only in 1 location that fires
street the solution is not the best point of view because of this project and but this is against the as we derive some system to gain information is you use for example from network VPN and so on and then he passes through a convenient objects which renders the out so every
time a new idea I write connecting for it finds this groups get the information and produce this out with very very
easy way that you think you have to take care is the format of the output because without
further you need to use the the syntax so when in input sparse descriptive yeah querying it 3 return as an output of a that need to be about the same as of the spike sorting OK this is the same as that by transcript needs to generate you have 1 or more than I can say about the roles of the idea of the output you can specify a title as a title in icon and you can specify also the value that is best to the next set of their work when an error is a clicker and then you can also specify Gifford optical bleeding or not so if you hidden so you you don't need to the commons but just the 1st part 2nd example
just to so you have the capabilities where that the
z automatically integrates the lists also and spent in different kinds and used to work with people coming from different areas of the world so without leaving my workflow opening for example a browser to check the time and so they just can't that it is a and doesn't what they need
them the 3rd example is translated assume that you are writing any writing and document something something like that and you need to translate award that you can
type yeah and then the world
for example chasm which is found in means the houses which is the same in English and knowledge results and so you can also translated sentences
Gomes that's how you and so unfortunately don't speak the lower electrode friends and once you select the 1 the
rope it's copied to the clipboard in you can based on whatever you want so you don't have to leave a long who will translate at the sentence and so on how is translate
translated why doesn't work
what have I don't want to waste your time and this is the simplest case that check the translation we Google Translate the candle I can also
create simple notes for example if I just want to remember who to call up
my friend and I for example can type model and that the
medical so you know course
material g they could become
kind in indeed ultimately I the action to a In the
scramble very simple we can go on currency from the you need to all how much is there
1 thousand euros it finds script which low on and in this case I think it uses the Laplace and do some calculations and outputs a tool to screen
now let's let's see something more interesting for you
developers pretty finding
consider I have these Jason
for example this is adjacent this is an unified version of the Jason I needed to predict ranking how can I do that I simply copied to the to the clipboard then pretty fighting then choose Jason and when they pass the base that I have the predefined evaluation of the users Jason I can do
the same lever for SQL for example experience I work with that of a
is I have we have the right in in the worst way possible in the world pretty 5 this throughout and then based I illustrate that there is a procedure inside of the state so that means that the past this dual and provided a predefined the last example of
OK varies with these approaches you can that you don't have to rely on a specific tool already or something in there that you can
prettify whatever you want in every 2 that's managing
consider you have these list for
example came this is a and use of member country of the union if you need to do some operation on each line on this list that you can conveniently copy the least then activate from user that takes the common and then you seen the subtitles you can use text or line to manage that means that if you use the fact that we consider all things that if you use line it considers every line the each time so of the least so for example if a bus line busses a page for a child it depends a single quote the beginning a single report plus a common the end so I converted this release to a friendly format race but again or what whatever I want using the Python saying that for example if I want to remove they come and see Walter and a taking do line 1 2 minister and it's the same I'm using the advances the string manipulation Future of Python to welcome a that this simple tax and this creates when it's fire that's the least that splits it using carriage-return and executes the common that best on every single line once more to extreme line for example replace space so we have and the story right simple next sample creating
documents is going before and I have necessity to
create a different versions of the documents just changing simple parts of documents so what they did is to create a thin plate and then fill this template with information In this case the taking type boxes it
s which is the project they the 1 2 3 4 . tasks me the telephone general kind burgeoning name and go to move project our brains generate fast and in the outer edges of my documents generated can you see
projected the project name alpha and so on OK I know
what you're thinking of things thinking yes but the writing these of emissions to thinks that I know
because the right of for example these scripts it took me about 3 hours but if you consider that there on discrete many many times during the yeah I can see that a bigger amount of time that the 3 hours to write down the script then I can also
act on files for example not going strings if I go to sorry the
best of your Python I have to images the cathedral of my
town and if if a time that option and space
by I created this action kobe findings to breed more copy from inscrutable without and rotates clockwise rotate counterclockwise OK at
that rotates it automatically
rotates the image I want to work so when I type option and common by automatically passed through a Python script to the name of the file and then I can use a BA a library or whatever you want to think I'm using here the major major major key to to rotate major and to that proper comments other
examples keyboard my physical before in his my preferred to 4 outputs so if the data if a type hormone and among other
metadata it creates a burst personal forecast that we and there's also for the next hour so and next nothing and tremendously complicated of course but I want to show you how it's possible to output also in more detail and bunch of information so that the only that the single lines you you seen that we that we got from before you can also
work on the she for find for example OK this is a script that created the for confrontation prominently displayed seasonal fire and you can do whatever you want so last
example that suspension I
have defined some macros
that that interact with my browser disease the 1st is that
in this paper and Frente missing typing going for example names text data double promise the title
it expands to it expands with the Chrome title effect see you will it expands with the crumbling your for c the inca page 4 so sorry see
age for an HTML link or see link and for a month so I don't have to to copy and paste this single titles and your for cheat short for a condition link if you see that correspond the courts pretty pretty simple get from your father when I see you around this type the these script is fine and any can interact with the world problem using AppleScript in this case because of course and also script external states
last category our finally the system trigger
actions the best of the of of the of the OK I created this fall they're called the resizing and this time I call for example in major inside this folder the major are ultimately resized because they have a trigger that automatically takes their immediate boss to 2 Hazel endophytes Python script that that does the magic OK these were the last 2 ideas of what you can how to make them I show you some needs that the had the hand that they solved using automation and can go fundamentally whatever you want and the only thing you have to consider is how much time do you spend the repeating a task and then how you can calculate does that as the last sentence remember that can do the same thing going on mobile devices because the example the you have passed in on US here's a workflow by Tony Stark and so on that are used so that can automate repetitive tasks also on a mobile device we have no time to talk about but you can use these tools and for example by police and tasks Southport's also by OK thank thank you all and the 1st
work this the yes of this criticism of yes it is asking me if there is a repository for this this man on the phone and you on yeah OK yeah yeah have repositories for each was so for example if you want the text on the side door on sides you have specific is maybe the solution is not the right thing using Python and and other languages but you can find want if you'll want to look at some point in the presentation and then it was believed that the nation OK
or on my side from the next Monday you can
find all the beasts of the examples they should thank you thank you
Slide rule
Process (computing)
Computer animation
Presentation of a group
Software
Hypermedia
Point (geometry)
Procedural programming
Mereology
Subtraction
Task (computing)
Email
Metropolitan area network
Computer animation
Information
Software developer
Software developer
Boom (sailing)
Software
Set (mathematics)
Euler angles
Task (computing)
World Wide Web Consortium
Point (geometry)
Mobile app
Divisor
INTEGRAL
Multiplication sign
Parameter (computer programming)
Number
Twitter
Data management
Goodness of fit
Mathematics
Internetworking
String (computer science)
Software testing
Information
Subtraction
Task (computing)
Run time (program lifecycle phase)
Focus (optics)
Process (computing)
Touchscreen
Information
Interactive television
Planning
3 (number)
Line (geometry)
Port scanner
Cartesian coordinate system
Local Group
Single-precision floating-point format
Word
Process (computing)
Computer animation
Lattice (order)
Software
Information retrieval
Procedural programming
Data type
Data management
Task (computing)
Resultant
Computer animation
Data management
Reading (process)
Group action
State of matter
Line (geometry)
Multiplication sign
File system
Thermal expansion
Web browser
Goodness of fit
Mathematics
Linker (computing)
Position operator
Physical system
Social class
User interface
Information
Cellular automaton
Computer file
Keyboard shortcut
Moment (mathematics)
Interface (computing)
Ext functor
Thermal expansion
Group action
Cartesian coordinate system
Category of being
Macro (computer science)
Computer animation
Data type
Line (geometry)
Thermal expansion
Similarity (geometry)
Line (geometry)
Expandierender Graph
Mereology
Table (information)
Exterior algebra
Computer animation
Software
Utility software
File system
Key (cryptography)
Astrophysics
Window
Keyboard shortcut
Multiplication
Line (geometry)
1 (number)
Thermal expansion
Parameter (computer programming)
Expandierender Graph
Computer animation
Software
output
Key (cryptography)
Astrophysics
Data management
Arc (geometry)
Window
Point (geometry)
Email
Keyboard shortcut
Group action
Line (geometry)
Scientific modelling
Mathematical singularity
Home page
Combinational logic
Icosahedron
Cross-correlation
Metropolitan area network
Touchscreen
Process (computing)
Frustration
Block (periodic table)
Sequence
Word
Arithmetic mean
Computer animation
Personal digital assistant
Logic
Charge carrier
output
Data type
Keyboard shortcut
Group action
Computer file
State of matter
Code
Multiplication sign
Cellular automaton
Ext functor
Web browser
Expandierender Graph
Cartesian coordinate system
Connected space
Medical imaging
Computer animation
Integrated development environment
String (computer science)
Cuboid
Data type
Data management
Resultant
Physical system
Metropolitan area network
Link (knot theory)
Block (periodic table)
Computer file
Computer-generated imagery
Thermal expansion
Ext functor
Electronic mailing list
Batch processing
Uniform resource locator
Category of being
Computer animation
Software
File system
Personal area network
Ideal (ethics)
Information
Procedural programming
Electronic visual display
Task (computing)
Exception handling
Asynchronous Transfer Mode
Metropolitan area network
Spacetime
Information
Multiplication sign
Line (geometry)
Function (mathematics)
Storage area network
Internet forum
Uniform resource locator
Computer animation
Computer network
Gamma function
Data management
Data type
Point (geometry)
Metropolitan area network
Computer animation
Information
View (database)
Computer network
Smart card
Object (grammar)
Gamma function
Physical system
Metropolitan area network
Plasma display
File format
Multiplication sign
Function (mathematics)
Set (mathematics)
Mereology
Automorphism
Local Group
Computer icon
Sparse matrix
Computer animation
Optics
output
Information
Gamma function
output
Error message
Descriptive statistics
Area
Metropolitan area network
Internet forum
Computer animation
Electronic mailing list
Personal area network
Web browser
Hand fan
Emulation
Metropolitan area network
Computer animation
Data type
Hand fan
Form (programming)
Writing
Resultant
Metropolitan area network
Computer animation
Metropolitan area network
Plasma display
Computer animation
Personal digital assistant
Multiplication sign
Translation (relic)
Gamma function
Storage area network
Metropolitan area network
Internet forum
Group action
System call
Computer animation
Scientific modelling
Gamma function
Data type
Hand fan
Form (programming)
Urinary bladder
Maxima and minima
Metropolitan area network
Calculation
Touchscreen
Computer animation
Personal digital assistant
Least squares
Personal area network
Hand fan
Maxima and minima
Revision control
Performance appraisal
Metropolitan area network
Internet forum
Uniform resource locator
Computer animation
Software developer
Personal area network
Gamma function
Hand fan
Metropolitan area network
Computer animation
State of matter
Logarithm
Gamma function
Maxima and minima
Metropolitan area network
Zoom lens
Computer animation
Weight
Gamma function
Storage area network
Maxima and minima
Web page
Metropolitan area network
Zoom lens
Spacetime
File format
Multiplication sign
Electronic mailing list
Sampling (statistics)
Line (geometry)
Extreme programming
Hand fan
Storage area network
Maxima and minima
Computer animation
String (computer science)
Operator (mathematics)
Personal area network
Right angle
Gamma function
Traffic reporting
Form (programming)
Uniform space
Revision control
Metropolitan area network
Computer animation
Information
Personal digital assistant
Modal logic
Cuboid
Mereology
Sturm's theorem
Data type
Form (programming)
Template (C++)
Metropolitan area network
Computer animation
Projective plane
Personal area network
Density of states
Task (computing)
Alpha (investment)
Metropolitan area network
Computer file
Sine
Multiplication sign
Computer file
Java applet
Drop (liquid)
Hand fan
Word
Escape character
Computer animation
String (computer science)
Right angle
Drum memory
Gamma function
Cuboid
Metropolitan area network
Medical imaging
Group action
Spacetime
Computer animation
Computer configuration
Executive information system
Line (geometry)
Multiplication sign
Gamma function
Hand fan
Maxima and minima
Metropolitan area network
Medical imaging
Computer animation
Key (cryptography)
Computer file
Computer configuration
Data type
Library (computing)
Mach's principle
Maxima and minima
Metropolitan area network
Computer animation
Information
Keyboard shortcut
Function (mathematics)
Line (geometry)
Data type
Form (programming)
Hand fan
Metadata
Maxima and minima
Metropolitan area network
Computer icon
Computer animation
Web page
Metropolitan area network
Software bug
System call
Set (mathematics)
Computer file
Electronic program guide
Interactive television
Sound effect
Price index
Digital signal
Web browser
Discrete element method
Storage area network
Internet forum
Computer animation
Whiteboard
Graphical user interface
Gamma function
Macro (computer science)
Graphical user interface
Window
Metropolitan area network
Category of being
Computer animation
State of matter
Linker (computing)
Personal digital assistant
Gamma function
Conditional-access module
Data type
Condition number
Physical system
Maxima and minima
Point (geometry)
Metropolitan area network
Boss Corporation
Group action
Presentation of a group
Multiplication sign
Mobile Web
Basis (linear algebra)
Limit (category theory)
Group action
Discrete element method
Formal language
Computer animation
Repository (publishing)
Metropolitan area network
Task (computing)
Computer animation
Transport Layer Security
Port scanner
Batch processing
Loading...
Feedback

Timings

  994 ms - page object

Version

AV-Portal 3.8.0 (dec2fe8b0ce2e718d55d6f23ab68f0b2424a1f3f)