[PYTHON] Manage deals with Trello + Google Colaboratory (Part 1)

In this series, we'll consider managing deals in Trello and analyzing them in Google Colaboratory.

1. Goals of this series

Handles Trello + Google Colaboratory for managing opportunities. A simple context diagram is shown below.

無題の図形描画 (3).png

I haven't used Google Colaboratory at the time of this writing, so the feasibility of such a configuration is not yet known. We will revise this article as soon as it is known. Even if it doesn't happen, it won't have much effect as this box will just replace the Jupyter Notebook.

As I myself will be the sales person and forecast meeting attendee listed here, my goal is to be easy for me to use and report. In addition, we will proceed on the premise that everything can be done with a free frame.

This article covers background topics and Trello preparation as an introduction.

2. Assumed sales process

The process introduced in the book THE MODEL/Yasutaka Fukuda (2019), which is highly evaluated as a sales textbook, is used as ** reference . I want to avoid mere impersonation, so I would like to refer to this and introduce it according to my company's culture and customers. Regarding this, Mr. Fukuda himself, the author of THE MODEL, said, " It is not good to implement THE MODEL as it is **" (https://note.com/yfukuda0709/n/na2ad992bdc83).

41lSAQ-5R+L.SY344_BO1,204,203,200.jpg

However, you and I, who are readers, have different circumstances, so we will start with the discussion based on the book.

3. Create a board with Trello

I created the following board in Trello. How to operate is also described in red. image.png

The contents of the phase names and definitions described here are quoted from those ** illustrated in THE MODEL introduced above. You can change it according to your corporate culture and customers. I am operating with a different phase definition.

I think it's a good idea to keep this phase definition prominent in early operations and on new member boards. For those who do not understand the sales process, the phase name alone does not make sense, and there is a high possibility that the process will become a mere ghost.

In addition, each definition card describes the criteria for transition to the next phase as follows. (This is also a quote from THE MODEL) image.png

Name each matter card {Customer Name} _ {Matter Name} so that you can see the details of the matter as follows. image.png

We have also adopted some of the rules below for processing in Python in the future.

4. Get API Key and Token with Trello

Get the API token by referring to the official guide (https://developer.atlassian.com/cloud/trello/guides/rest-api/api-introduction/) and the guide that came out by google.

4.1. Access the API acquisition site

Visit here: https://trello.com/app-key image.png

Copy and paste the key into Notepad to move to the token generation screen.

4.2. Token generation

Click the link above and scroll down to see the screen below. image.png

You can see that the token is generated when you click "Allow". Copy and paste this into Notepad as well.

Please do not share keys or tokens.

5. Confirm that the board information can be obtained

Qiita is like a programming information knowledge community, so I also have to share programming information in this article.

Install py-trello locally and try to get the card you created earlier. In addition, py-trello is also used in Google Colaboratory, but Google Colaboratory has not appeared yet in this article. If you do not check the operation locally, you do not need to read this chapter.

5.1. Installing py-trello

py-trello is a library for trello cooperation. Since it can be installed with pip, please install it in your own environment as shown below.

$ pip3 install py-trello

5.2. Get various information from the board

You can get various information from the board by pouring the following code in Python. If you make the same thing as me, you should get the same result. Please enjoy it.

from trello import TrelloClient

trello_client = TrelloClient(
    #List the key and token you got earlier
    api_key = '',
    token = ''
)

#Get a list of board names
[x.name for x in trello_client.list_boards()]

#The target board'Opportunities'Get the board (it's a problem if the board name is not unique)
opps_board = [x for x in trello_client.list_boards() if x.name == 'Opportunities'][0]

#Get a list of matter phases
opps_board.get_lists(list_filter='all')
# [<List Ph.1 lead or more and less than negotiation>, <List Ph.2 Recognition of business issues>, <List Ph.3 Evaluation and selection>, <List Ph.4 Final negotiations and decision making>, <List Ph.5 Approval approval process>, <List Closed (Won/Lost)>]

#Acquire the number of projects in each phase
{x.name: len([y for y in x.list_cards() if not y.name.startswith('.')]) for x in opps_board.get_lists(list_filter='all')}
# {'Ph.1 lead or more and less than negotiation': 1, 'Ph.2 Recognition of business issues': 0, 'Ph.3 Evaluation and selection': 0, 'Ph.4 Final negotiations and decision making': 0, 'Ph.5 Approval approval process': 0, 'Closed (Won/Lost)': 0}

#Customer name list
set(x.name.split('_')[0] for x in opps_board.get_cards() if not x.name.startswith('.'))
# {'Rip-off printing Co., Ltd.'}

6. Summary and next notice

This article covered the following topics:

Next time, I will deal with the following topics.


7. Appendix Why this combination?

Reasons for not using SFA such as Salesforce

In the part related to business operation, I thought that if the completed system was introduced first, it would become a mere impersonator and the essence would not be visible. Another big reason is that it's not big enough to feel the need to pay for something that can be managed on post-it notes.

The reason for Trello

There is an API and it works slurping, and any operation can be realized. Also, even if Trello disappears at worst, you can replace it with Post-it.

Reasons for Google Colaboratory

Free Jupyter Notebook hosting service. In the worst case, if Google Colaboratory is gone, you can run Jupyter Notebook locally, and even if it is gone, you can replace it with a paper notebook.

The point is that no matter what happens, the operation of business negotiation management can be continued!

Recommended Posts

Manage deals with Trello + Google Colaboratory (Part 1)
Study Python with Google Colaboratory
Try OpenCV with Google Colaboratory
OpenCV feature detection with Google Colaboratory
Google colaboratory
How to search Google Drive with Google Colaboratory
Using Java's Jupyter Kernel with Google Colaboratory
Use TPU and Keras with Google Colaboratory
I tried simple image processing with Google Colaboratory.
Cheat sheet when scraping with Google Colaboratory (Colab)
How to load files in Google Drive with Google Colaboratory
End-to-End single channel sound source separation with Google Colaboratory
How to analyze with Google Colaboratory using Kaggle API
Easy learning of 100 language processing knock 2020 with "Google Colaboratory"
Building an environment to use CaboCha with google colaboratory
Authenticate Google with Django
Is it Google Colaboratory?
sandbox with neo4j part 10
Code snippets often used when processing videos with Google Colaboratory
Feature Engineering for Machine Learning Beginning with Part 3 Google Colaboratory-Scaling
Try to implement linear regression using Pytorch with Google Colaboratory