Andi5986 commited on
Commit
1f4d383
·
1 Parent(s): adfa1d0

Upload 4 files

Browse files
Files changed (4) hide show
  1. LICENSE +48 -0
  2. README.MD +33 -0
  3. app.py +37 -0
  4. requirements.txt +2 -0
LICENSE ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Copyright (c) [2023] [andi5986]
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ SOFTWARE.
20
+
21
+
22
+
23
+
24
+
25
+ User
26
+ I want to put it in the github
27
+ ChatGPT
28
+ Great! Here are the steps to add your MIT License to your GitHub repository:
29
+
30
+ Navigate to your repository on GitHub.
31
+
32
+ Click on the "Add file" button near the right of the screen, and then click "Create new file."
33
+
34
+ In the "Name your file" text box, enter "LICENSE".
35
+
36
+ In the body of the new file, copy and paste the text of the MIT License template provided above, replacing [year] and [fullname] with the current year and your name or your organization's name.
37
+
38
+ Scroll to the bottom and enter a brief message describing your changes, such as "Added MIT License."
39
+
40
+ Make sure the "Commit directly to the main branch" option is selected, and then click "Commit new file."
41
+
42
+ That's it! Your GitHub repository now includes an MIT License.
43
+
44
+
45
+
46
+
47
+
48
+
README.MD ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Project Title: CSV Searcher
2
+ A simple web application using Streamlit and Pandas, to help you search through a database of talented individuals based on specific attributes.
3
+
4
+ Table of Contents
5
+ Installation
6
+ Usage
7
+ License
8
+ Installation
9
+ Before starting, ensure you have the following requirements:
10
+
11
+ Python 3.6 or later
12
+ Streamlit 0.84.0 or later
13
+ Pandas 1.3.0 or later
14
+ You can install these packages using pip:
15
+
16
+ bash
17
+ Copy code
18
+ pip install streamlit pandas
19
+ Usage
20
+ Start the Streamlit app by navigating to the directory containing the script and running:
21
+ bash
22
+ Copy code
23
+ streamlit run main.py
24
+ Navigate to the URL provided in your terminal to view the app in your web browser.
25
+
26
+ On the sidebar, upload your CSV file containing data about various talents using the 'Upload your Talent CSV' button.
27
+
28
+ In the main section of the app, input any attributes you wish to search for in the database.
29
+
30
+ The application will display the corresponding rows from the CSV file that match your search criteria. The search is case-insensitive and can be performed on both string and numeric columns.
31
+
32
+ License
33
+ This project is licensed under the MIT License. See the LICENSE file for details.
app.py ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import pandas as pd
3
+
4
+ uploaded_file = st.sidebar.file_uploader('Upload your Talent CSV')
5
+ if uploaded_file is not None:
6
+ df = pd.read_csv(uploaded_file)
7
+
8
+ def main():
9
+ st.title('Search for your star')
10
+
11
+ search_term = st.text_input('Enter attributes')
12
+
13
+ if search_term:
14
+ # Split the search term into individual words
15
+ search_terms = search_term.split()
16
+
17
+ # Initialize a mask to select all rows
18
+ mask = pd.Series([True] * len(df))
19
+
20
+ for term in search_terms:
21
+ # Case-insensitive search in all String columns
22
+ string_cols = df.select_dtypes(include='object')
23
+ term_mask = string_cols.apply(lambda x: x.str.contains(term, case=False, na=False)).any(axis=1)
24
+
25
+ # Case-insensitive search in all numeric columns
26
+ numeric_cols = df.select_dtypes(include='number')
27
+ term_mask |= numeric_cols.apply(lambda x: x == pd.to_numeric(term, errors='coerce')).any(axis=1)
28
+
29
+ # Combine the mask for this term with the overall mask
30
+ mask &= term_mask
31
+
32
+ results = df[mask]
33
+
34
+ st.write(results)
35
+
36
+ if __name__ == "__main__":
37
+ main()
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ pandas==2.0.1
2
+ streamlit==1.22.0