Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
-Updated packages
-Added .NET 7 target
-Dropped .NET 5 target
-Added console app project for testing
  • Loading branch information
tforsberg committed Oct 3, 2022
1 parent c587ad8 commit eef4ae9
Show file tree
Hide file tree
Showing 8 changed files with 143 additions and 12 deletions.
14 changes: 10 additions & 4 deletions FinancialModelingPrepApi.sln
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31229.75
# Visual Studio Version 17
VisualStudioVersion = 17.3.32922.545
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FinancialModelingPrepApi", "FinancialModelingPrepApi\FinancialModelingPrepApi.csproj", "{B691C86E-CE23-40FA-811E-8D17BE9DD8BE}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FinancialModelingPrepApi", "FinancialModelingPrepApi\FinancialModelingPrepApi.csproj", "{B691C86E-CE23-40FA-811E-8D17BE9DD8BE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{239A9A06-4A6A-47E8-9255-C9C5FA1BF13D}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tests", "Tests\Tests.csproj", "{239A9A06-4A6A-47E8-9255-C9C5FA1BF13D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestingConsoleApp", "TestingConsoleApp\TestingConsoleApp.csproj", "{AB22BC30-B6E2-4DED-946E-5C9ADDBB47B0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -21,6 +23,10 @@ Global
{239A9A06-4A6A-47E8-9255-C9C5FA1BF13D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{239A9A06-4A6A-47E8-9255-C9C5FA1BF13D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{239A9A06-4A6A-47E8-9255-C9C5FA1BF13D}.Release|Any CPU.Build.0 = Release|Any CPU
{AB22BC30-B6E2-4DED-946E-5C9ADDBB47B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AB22BC30-B6E2-4DED-946E-5C9ADDBB47B0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AB22BC30-B6E2-4DED-946E-5C9ADDBB47B0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AB22BC30-B6E2-4DED-946E-5C9ADDBB47B0}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
56 changes: 56 additions & 0 deletions FinancialModelingPrepApi/Class1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MatthiWare.FinancialModelingPrep;

public class Rootobject
{
public Class1[] Property1 { get; set; }
}

public class Class1
{
public string date { get; set; }
public string symbol { get; set; }
public string reportedCurrency { get; set; }
public string cik { get; set; }
public string fillingDate { get; set; }
public string acceptedDate { get; set; }
public string calendarYear { get; set; }
public string period { get; set; }
public long revenue { get; set; }
public long costOfRevenue { get; set; }
public long grossProfit { get; set; }
public float grossProfitRatio { get; set; }
public long researchAndDevelopmentExpenses { get; set; }
public float generalAndAdministrativeExpenses { get; set; }
public float sellingAndMarketingExpenses { get; set; }
public long sellingGeneralAndAdministrativeExpenses { get; set; }
public float otherExpenses { get; set; }
public long operatingExpenses { get; set; }
public long costAndExpenses { get; set; }
public long interestIncome { get; set; }
public long interestExpense { get; set; }
public long depreciationAndAmortization { get; set; }
public long ebitda { get; set; }
public float ebitdaratio { get; set; }
public long operatingIncome { get; set; }
public float operatingIncomeRatio { get; set; }
public long totalOtherIncomeExpensesNet { get; set; }
public long incomeBeforeTax { get; set; }
public float incomeBeforeTaxRatio { get; set; }
public long incomeTaxExpense { get; set; }
public long netIncome { get; set; }
public float netIncomeRatio { get; set; }
public float eps { get; set; }
public float epsdiluted { get; set; }
public long weightedAverageShsOut { get; set; }
public long weightedAverageShsOutDil { get; set; }
public string link { get; set; }
public string finalLink { get; set; }
}


Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ public Task<ApiResponse<List<CashFlowResponse>>> GetCashFlowStatementAsync(strin
return client.GetJsonAsync<List<CashFlowResponse>>(url, pathParams, queryString);
}

public Task<ApiResponse<List<IncomeStatementResponse>>> GetIncomeStatementAsync(string symbol, Period period = Period.Quarter, int? limit = 40)
public Task<ApiResponse<List<IncomeStatementResponse>>> GetIncomeStatementAsync
(string symbol, Period period = Period.Quarter, int? limit = 40)
{
const string url = "[version]/income-statement/[symbol]";

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using MatthiWare.FinancialModelingPrep.Model;
using MatthiWare.FinancialModelingPrep.Model.CompanyValuation;
using Refit;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace MatthiWare.FinancialModelingPrep.DataAccess.CompanyValuation
{
public interface IIncomeStatementData
{
[Get(path: "/income-statement/{symbol}")]
Task<IncomeStatementResponse> GetIncomeStatement(string symbol);

[Get(path: "/income-statement/{symbol}")]
Task<Model.ApiResponse<List<IncomeStatementResponse>>> GetIncomeStatementAsync(string symbol, Period period = Period.Quarter, int? limit = 40);

}
}
3 changes: 2 additions & 1 deletion FinancialModelingPrepApi/FinancialModelingPrepApi.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<RootNamespace>MatthiWare.FinancialModelingPrep</RootNamespace>
<PackageRequireLicenseAcceptance>False</PackageRequireLicenseAcceptance>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
Expand Down Expand Up @@ -36,6 +36,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Refit.HttpClientFactory" Version="6.3.2" />
</ItemGroup>

<PropertyGroup>
Expand Down
31 changes: 31 additions & 0 deletions TestingConsoleApp/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// See https://aka.ms/new-console-template for more information
using System;
using MatthiWare.FinancialModelingPrep;


Console.WriteLine("Hello, World!");

//Services.AddFinancialModelingPrepApiClient(new FinancialModelingPrepOptions()
//{
// ApiKey = "API-KEY-HERE"
//});

//var api = ServiceProvider.GetRequiredService<IFinancialModelingPrepApiClient>();

//// do something with api like getting the latest Apple Stock Quote
//var quoteResult = await api.CompanyValuation.GetQuoteAsync("AAPL");


FinancialModelingPrepOptions financialModelingPrepOptions = new FinancialModelingPrepOptions()
{
ApiKey = "7a711b4efd6f42664961b587f8944130"
};

var api = FinancialModelingPrepApiClientFactory.CreateClient(financialModelingPrepOptions);

// do something with api like getting the latest Apple Stock Quote
var quoteResult = await api.CompanyValuation.GetQuoteAsync("TSLA");

Console.WriteLine(quoteResult.Data);


14 changes: 14 additions & 0 deletions TestingConsoleApp/TestingConsoleApp.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\FinancialModelingPrepApi\FinancialModelingPrepApi.csproj" />
</ItemGroup>

</Project>
12 changes: 6 additions & 6 deletions Tests/Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Divergic.Logging.Xunit" Version="4.1.0" />
<PackageReference Include="Divergic.Logging.Xunit" Version="4.2.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
<PackageReference Include="Moq" Version="4.18.1" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="Moq" Version="4.18.2" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Expand Down

0 comments on commit eef4ae9

Please sign in to comment.